Hardware Reference
In-Depth Information
python-oauth2
python-oauth2 is hosted on GitHub at http://github.com/simplegeo/python-oauth2, so
you obtain it through git rather than wget . In a terminal, type the following:
git clone “http://github.com/simplegeo/python-oauth2
cd python-oauth2
python setup.py build
sudo python setup.py install
cd ..
The final step is to install the python-twitter module.
wget “http://python-twitter.googlecode.com/files/
python-twitter-0.8.2.tar.gz”
tar xvf python-twitter-0.8.2.tar.gz
cd python-twitter-0.8.2
python setup.py build
sudo python setup.py install
cd ..
If you have IDLE open, close all the windows and restart it so it can access the newly installed
modules.
Talking to Twitter
Twitter requires programs that access it automatically to send authentication information
with requests. This allows Twitter to prevent abuse by blocking programs that put too much
load on its servers. Your program will authenticate itself to Twitter by sending secret tokens.
Getting Access Tokens for Twitter
You will need to get four pieces of information by signing into the developers' part of Twitter.
This section explains how to get a consumer_key , consumer_secret , access_token_
key and access_token_secret . The names sound confusing, but all they are is a secret
code that will identify you and your program to Twitter.
Visit https://dev.twitter.com/apps/new and log in. (You will need to sign up to
Twitter if you don't have an account.) If you're not old enough to have your own Twitter
account you could ask a parent, guardian or teacher to do this for you.
Enter the name of your application, a brief description and a website. If you don't have a
website you could enter www.example.com as a placeholder. Read the terms and click to
indicate your acceptance of the terms. Fill in the CAPTCHA and then click Create Your
Twitter Application. You may need to enter a different name for your application if it is
already in use; you could try prefixing it with your Twitter username.
Search WWH ::




Custom Search