Skip to content

Instantly share code, notes, and snippets.

@sputnikus
Created October 28, 2012 19:50
Show Gist options
  • Save sputnikus/3969657 to your computer and use it in GitHub Desktop.
Save sputnikus/3969657 to your computer and use it in GitHub Desktop.
Twitter list members stats
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import csv
from tweepy import Cursor
from tweepy import api
def run():
members = Cursor(api.list_members, 'owner-name', 'list-slug').items()
with open('tw_list.csv', 'wb') as csvfile:
writer = csv.writer(csvfile)
print 'Killing birds'
for member in members:
writer.writerow((member.screen_name, member.statuses_count,
member.friends_count, member.followers_count))
if __name__ == '__main__':
run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment