Last active
January 5, 2018 01:19
-
-
Save mys721tx/7d6432f9fc090396f488da95317118b0 to your computer and use it in GitHub Desktop.
Get twitter followers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
get_follower.py | |
""" | |
import twitter #python-twitter | |
auth = { | |
"consumer_key": "", | |
"consumer_secret": "", | |
"access_token_key": "", | |
"access_token_secret": "" | |
} | |
api = twitter.Api(**auth) | |
next_cursor = -1 | |
with open("follower.csv", "w") as data: | |
while True: | |
next_cursor, _, users = api.GetFollowersPaged( | |
screen_name="", | |
cursor=next_cursor | |
) | |
for user in users: | |
data.write("{}\n".format(user.id)) | |
if not next_cursor: | |
break |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment