Editing DS4UX (Spring 2016)/Day 6 coding challenge

From CommunityData
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
 
<div style="font-family:Rockwell,'Courier Bold',Courier,Georgia,'Times New Roman',Times,serif; min-width:10em;">
Each of the challenges this week are related to the [[DS4UX_(Spring_2016)/Panama Papers|Panama Papers project]] which you should have installed and begun working with in class.
<div style="float:left; width:100%; margin-right:2%;">
{{Link/Graphic/Main/2
|highlight color= 27666b
|color=460c40
|link=
|image=
|text-align=left
|top font-size= 1.1em
|top color=FFF
|line color=FFF
|top text=This page is a work in progress.
|bottom font-size= 1em
|bottom color= FFF
|bottom text=
|line= none
}}</div></div>


This week, you will be required to attempt the first 5 challenges in this list using Python and the <code>requests</code> module to gather data from APIs. You must upload your solution scripts via Canvas before class. You will NOT be graded on whether your solutions are correct, efficient, or even functional—just on whether you turn in an attempt at a solution that shows you tried. You WILL be marked down if you don't submit your solutions—so be sure to spend time attempting these challenges!
This week, you will be required to attempt the first 5 challenges in this list using Python and the <code>requests</code> module to gather data from APIs. You must upload your solution scripts via Canvas before class. You will NOT be graded on whether your solutions are correct, efficient, or even functional—just on whether you turn in an attempt at a solution that shows you tried. You WILL be marked down if you don't submit your solutions—so be sure to spend time attempting these challenges!
Line 9: Line 24:




:1. Which editor has made the total most edits to the article ''[[w:Panama_Papers| Panama Papers]]'' so far?
:1. Who made the total most edits to the article ''[[w:Panama_Papers| Panama Papers]]''?
:2. How many edits per day did Panama Papers receive, on average, in its first two weeks?
:2. What’s the number of edits per day in the first two weeks of the article's existence?
:3. What hour in the first two weeks had the highest number of edits?
:3. What’s the peak number of edits per hour of the article? When did it occur?
:4. Who were the top 3 editors during that hour?
:4. Who were the top editors during that hour?
:5. What day in the first two weeks had the most views?
:5. What day did ''Pentagon Papers'' have the most views, and how many views did it have?




;Bonus challenges
;Bonus challenges
:6. Write a script that generates daily edit and view counts for Panama Papers over its first 30 days of existence, and prints them to a CSV or TSV file in reverse-chronological order. You file should have three colums with the headers "date", "edits" and "views".
:7. Write a script that generates daily page view counts for Panama Papers, broken down by desktop and mobile (app + web) access methods over its first 30 days of existence, output them to a CSV file that you can open in Excel or a similar spreadsheet program, and use your data to create a graph of pagesviews by access method over time. Make sure your graph [http://www2.cs.uregina.ca/~rbm/cs100/notes/spreadsheets/tufte_paper.html follows sound information design principles]!
:8. Write a script that generates daily page view counts for Panama Papers on German (de.wikipedia.org), English (en.wikipedia.org), and Spanish (es.wikipedia.org) Wikipedias. Output your results to CSV and graph them per the instructions for Challenge #6 above.
::Hint: the title of this article is in English across all three Wikipedias.
=== Solutions ===
<big>'''[https://jtmorgan.net/ds4ux/week6/panama-papers-solutions.zip Click here to download the solutions to this week's coding challenges]'''</big>


[[Category:DS4UX (Spring 2016)]]
:6. How many views does it have per day, on average?</li>
:7. How many views did it have per day on German Wikipedia?</li>
:8. Who’s the person named in the Panama papers with the most views to their Wikipedia page?
Please note that all contributions to CommunityData are considered to be released under the Attribution-Share Alike 3.0 Unported (see CommunityData:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To protect the wiki against automated edit spam, we kindly ask you to solve the following CAPTCHA:

Cancel Editing help (opens in new window)