You are here

Sample Source Code: Twitter API Mining Twitter: Exploring Trending Topics, Discovering What People are Talking About, and More Source Code Followers

This Python source code for Twitter API is based on "Mining the Social Web (2nd Edition)", and supplies code samples for authorizing application access, retrieving trends, displaying API responses as pretty-printed JSON, computing intersections of two set trends, collecting search results, extracting text, screen names, and hashtags from tweets, creating frequency distributions from words in tweets, using prettytable to display tuples in tabular format, calculation of lexical diversity, finding popular retweets, looking up authors of retweets, plotting frequencies of words, generating histograms of words, screen names, and hashtags, and generating histograms of retweets counts.