Created
August 11, 2013 05:57
Revisions
-
rhema created this gist
Aug 11, 2013 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,30 @@ from twython import Twython, TwythonError import time APP_KEY = ""#aka Consumer key APP_SECRET = ""#aka Consumer secret OAUTH_TOKEN = "16279554-"# aka Access token OAUTH_TOKEN_SECRET = ""# aka Access token secret user_timeline = None twitter = Twython(APP_KEY, APP_SECRET, OAUTH_TOKEN, OAUTH_TOKEN_SECRET) twitters = open("whitelist.txt").readlines() outfile = open("following.txt","a") for tw in twitters: try: print tw tw = tw.strip() following = twitter.get_friends_ids(screen_name=tw) print following following_strs = [] for f in following['ids']: following_strs+=[str(f)] outfile.write(",".join([tw]+following_strs)+"\n") outfile.flush() time.sleep(60) except TwythonError as e: print e