Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Collecting and Manipulating Twitter Data > Tinkering with Twitter’s API

Tinkering with Twitter’s API

A minimal wrapper around Twitter’s web API is available through a package called twitter (http://github.com/sixohsix/twitter) can be installed with easy_install per the norm:

$  easy_install twitter
Searching for twitter

...truncated output...

Finished processing dependencies for twitter

The package also includes a handy command-line utility and IRC bot, so after installing the module you should be able to simply type twitter in a shell to get a usage screen about how to use the command-line utility. However, we’ll focus on working within the interactive Python interpreter. We’ll work though some examples, but note that you can always skim the documentation by running pydoc from the terminal. *nix users can simply type pydoc twitter.Twitter to view the documentation on the Twitter class, while Windows users need to type python -mpydoc twitter.Twitter. If you find yourself reviewing the documentation for certain modules often, you can elect to pass the -w option to pydoc and write out an HTML page that you can save and bookmark in your browser. It’s also worth knowing that running pydoc on a module or class brings up the inline documentation in the same way that running the help() command in the interpreter would. Try typing help(twitter.Twitter) in the interpreter to see for yourself.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial