Homework 4: 1 Faculty - Directory - Py (50 Points)
Homework 4: 1 Faculty - Directory - Py (50 Points)
Submissions are due by 11:59PM on the specified due date. Submissions may be made on the
Blackboard course site under the Assignments tab. Late submissions will be accepted for a
10% penalty each day (up to 48 hours). Make sure your name and FSUID are in a comment
at the top of the file.
1
2 imgur_info.py (50 points)
Suggested modules: requests, json
Your job in this part of the assignment is to sort through Imgur user comment data. Your
program should begin by prompting the user to enter a username of an Imgur account.
http://imgur.com/user/<username>/index/newest/page/<num>/hit.json?scrolling
where <num> is a counter that starts at 0 and increases as needed. When there are no more
comments to receive, the next page in the sequence will simply contain an empty string. For
example, navigate to the page
http://imgur.com/user/LastAtlas/index/newest/page/0/hit.json?scrolling
Now, increase the page counter in the address by 1. If we set the page counter to 100, for
instance, we’ll see that the page is empty. However, there’s no way to know beforehand how
many pages each user requires.
If the username does not exist or has not been used to post any comments, you may simply
print a message and end the program. Otherwise, you should sort through the user’s comment
data to find the top 5 comments (i.e. the comments with the most points). Your output should
list these comments in descending order of points, detailing the post identifier (the “hash”), title
of the post commented on, number of points received, and timestamp or the comment. In the
case of a tie between points, break the tie by comparing “hash” values.
2. wEF0R
Points: 11
2
Title: What a guy
Date: 2015-08-02 04:00:30
3. ZsqSJ
Points: 7
Title: MRW I find out I am unknowingly sharing a BF
Date: 2015-01-25 15:43:58
4. HfrBZSJ
Points: 5
Title: This is just magnificent
Date: 2014-02-17 03:42:57
5. NLiuVXC
Points: 5
Title: My wife...
Date: 2014-02-17 09:58:07