Skip to content

Instantly share code, notes, and snippets.

@jamesturk jamesturk/twitter2csv.py Secret
Last active May 2, 2018

Embed
What would you like to do?
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
You can’t perform that action at this time.