Homework 3 FAQ

I've been receiving some common questions about the programming assignment for Homework 3. I'm summarizing questions and answers here:

1. Do I need to get a Twitter account?

Answer: No. A Twitter account is not required for this assignment. If you use the URL schema shown in lecture for accessing a Twitter user's account, you are doing so, anonymously. This is perfectly fine but its one of the reasons that Twitter limits such requests to 150 requests per hour.

2. How do I find Twitter user names?

Answer: Head over to twitter.com and type search terms in the search box at the top of the page. You will get back a list of tweets containing the terms you entered. At the top of each tweet appears the full name and user name of the Twitter user who generated that tweet. You can click on that user name to see the user's profile, which should indicate how many tweets they have generated. Look for users who have more than 3200 tweets. Twitter will list their name as @ladygaga. You would then enter the name ladygaga into the URL schema that we discussed in lecture.

3. What's this URL schema thing you keep mentioning?

Answer: You will retrieve a “page” of tweets for a particular user by making an HTTP GET request on a URL that looks like the following:

http://twitter.com/statuses/user_timeline/<USER_NAME>.json?count=200&page=<PAGE_NUMBER>

As such, if you wanted the 15th most recent page of Lady Gaga (@ladygaga) tweets, you would hit Twitter with the following request:

http://twitter.com/statuses/user_timeline/ladygaga.json?count=200&page=&15

You can access 16 pages of 200 tweets per user for a total of 3200 tweets.

4. How many hundreds of users should my program collect tweets for?

Answer: Just nine. You can only make 150 requests on Twitter per hour. If you collect 16 pages of tweets for 9 users, that results in 144 requests which means you'll have to wait for a bit before Twitter will let you make a burst of requests like that again.

5. Printing out 28,800 tweets for each of my two program runs (sequential and concurrent) is going to take a lot of paper. Do I really need to bring a print out of my programs' output?

Answer: Yes, I do want a print out of your program but I do not want your program to be printing tweets to standard output. You should be storing tweets in a file (one file per user). You do not need to show me the contents of those files. Instead, your program should print a message to standard output for each page of tweets you request. A sample run might look like the following:

…
Retrieving page 5 for user "ladygaga".
Retrieving page 3 for user "justinbieber".
…
Finished retrieving tweets in 13.4 seconds.

6. What should I do if I make a request to Twitter and receive a 502 HTTP status error?

Answer: Putting the smarts into your program to handle this error (or any non-200 HTTP response) is out-of-scope for this assignment. You can print an error message to standard out (e.g. “Failed to retreive page 5 for user "alyankovic".”) and move on.

7. What should I do if this FAQ did not answer my question?

Answer: Send your question to Prof. Anderson and he'll update this FAQ!


© University of Colorado, Boulder 2011