You want to access your own data or another user’s data for analysis.
Take advantage of Twitter’s OAuth implementation to gain full access to Twitter’s entire API.
Twitter currently implements OAuth 1.0a, an authorization
mechanism expressly designed to allow users to grant third parties
access to their data without having to do the unthinkable—doling out
their username and password. Various third-party Python packages such as
provide easy-to-use abstractions for performing the “OAuth dance,” so
that you can easily implement client programs to walk the user through
this process. In the case of Twitter, the first step involved is
registering your application with Twitter at http://dev.twitter.com/apps
where Twitter provides you with a consumer key and
consumer secret that uniquely identify your
application. You provide these values to Twitter when requesting access
to a user’s data, and Twitter prompts the user with information about
the nature of your request. Assuming the user approves your application,
Twitter then provides the user with a PIN code for the user to give back
to you. Using your consumer key, consumer secret, and this PIN code, you
retrieve back an access token and access
token secret that ultimately are used to get you the
authorization required to access the user’s data.
Example 1-1 illustrates how to use the consumer key and consumer secret to do the OAuth ...