Twitter: Difference between revisions

Content added Content deleted
imported>Jesstess
imported>Jesstess
No edit summary
Line 105: Line 105:
If you have time, try out some of these extra exercises.
If you have time, try out some of these extra exercises.


=== 1. Customize how tweets are printed by <code>search</code> ===
<ol>
<li>
Customize how tweets are displayed. Look at the <code>Status</code> and <code>User</code> classes in the [http://code.google.com/p/python-twitter/source/browse/twitter.py| Twitter code] for inspiration; options include the URL for the tweet, how many followers the sender has, the location of the sender, and if it was a retweet.
</li>


The tweets printed by <code>search</code> could look much nicer and have more useful metadata!
<li>[Long] A lot of the Twitter API requires that you be authenticated. Examples of actions that require authentication include: posting new tweets, getting a user's followers, getting private tweets from your friends, and following new people.


Customize how tweets are displayed. Look at the <code>Status</code> and <code>User</code> classes in http://code.google.com/p/python-twitter/source/browse/twitter.py for inspiration; options include displaying:
Set up oAuth so you can make authenticated requests.
* the sender of the tweet
* the URL for the tweet
* how many followers the sender has
* the location of the sender
* if it was a retweet


and more!
http://dev.twitter.com/pages/auth describe how Twitter uses oAuth.

http://code.google.com/p/python-twitter/ has examples of using oAuth authentication to make authenticated Twitter API requests.
</li>
</ul>