Skip to content

Instantly share code, notes, and snippets.

@jamesturk
Last active May 2, 2018 02:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jamesturk/60d54c39717121f8db4dc1191ce95f1d to your computer and use it in GitHub Desktop.
Save jamesturk/60d54c39717121f8db4dc1191ce95f1d to your computer and use it in GitHub Desktop.
scripts to help manage twitter account
import twitter
import csv
# get these from https://apps.twitter.com/app/new
api_key = ''
api_secret = ''
access_key = ''
access_secret = ''
api = twitter.Api(consumer_key=api_key, consumer_secret=api_secret,
access_token_key=access_key, access_token_secret=access_secret)
with open('following.csv', 'w') as f:
out = csv.writer(f)
for friend in api.GetFriends(skip_status=True):
out.writerow((friend.name, friend.screen_name, friend.created_at,
friend.followers_count, friend.protected, friend.id,
#friend.status.created_at
))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment