Assignment 2

To prepare for this assignment, download either the java or the python twitter API and establish your credentials.

Assignment2 is posted.  Do Monday October 1 at 5pm PST.

Use the same homework turn-in form as before.  Be sure to put your name on your assignment writeup!

Sample Solution

Geobio Boo did a great job on this assignment.  I put his writeup into a slightly more readable file here, as well as his code and data:

Java

1) Download latest stable twitter4j library:
curl http://twitter4j.org/en/twitter4j-2.2.6.zip
2) Unzip into a folder:
unzip twitter4j-2.2.6.zip
3) Follow instructions in bin/readme.txt

These instructions will lead you through registering an app at http://dev.twitter.com (requires a Twitter account) and setting up your OAuth credentials so that you can access the Twitter API.

Python

Shreyas put together the following instructions:

https://github.com/ucbtwitter/getting-started/wiki/Accessing-Twitter-API