Tweepy is a module used to parse twitter easily and it is awesome
First your twitter application should be registered, this blog gives a step-by-step procedure for installation.
After registering your app,try this
import tweepy auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET) #Your consumer key and secret here auth.set_access_token(ACCESS_KEY, ACCESS_SECRET) #Your access key and secret here api = tweepy.API(auth) api.update_status('Hello tweepy')
Works like a charm!!.And remember not to give ur access or consumer keys to anyone for they may misuse it.
Now suppose you have a girlfriend called foobar and you want to stalk her profile.This will help.
page = 1 while(1): timeline = api.user_timeline('@foobar' , count = 200,page = page) if timeline for tweet in timeline print tweet.text page = page + 1 else: break
As simple as that , you can now see the tweets foobar has posted from the time she had a twitter account.Note that max.count = 200,and increasing beyond that wouldn’t impact ,and it doesnt print retweets.