python - How to get twitter followers using Twython? -


i want list of twitter followers/following of particular user, when screenname or user.id specified. can please give code snippet it? thanks.

i'm author of twython. there's 2 different methods can use this; 1 returns follower ids (get_followers_ids), , 1 returns statuses/etc of follower set (get_followers_list).

some example code 1 following:

from twython import twython  twitter = twython() followers = twitter.get_followers_ids(screen_name = "ryanmcgrath")  follower_id in followers:     print "user id %d following ryanmcgrath" % follower_id 

if have ids, you'd need further lookups yourself, latter method (get_followers_list) may want. keep in mind twython functions mirror api key parameters official twitter api docs, methods can pass argument same you'll find on docs.

good luck!


Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -