Skip to content

Instantly share code, notes, and snippets.

@drewconway
Created February 25, 2009 17:07
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drewconway/70281 to your computer and use it in GitHub Desktop.
Save drewconway/70281 to your computer and use it in GitHub Desktop.
import twitter
import networkx as NX
import time
# Create an authenticated Api object in order to download user data
api_user='your_twitter_id'
api_pswd='your_twitter_password'
api=twitter.Api(username=api_user,password=api_pswd)
# The seed user to be analyzed
seed='someone_who_needs_friends'
# Now create network
k=2 # Number of snowball rounds (WARNING: k>2 will most certainly exceed the Twitter API rate limit)
twitter_net=snowball_build(api,seed,k)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment