Editing Harry Potter on Wikipedia

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:
[[File:Wikipedia.png|right|250px]]
* Basic counting
__NOTOC__
** Answer question: ''What proportion of edits to Wikipedia Harry Potter articles are minor?''
== Building a Dataset using the Wikipedia API ==
*** Count the number of minor edits and calculate proportion
* Looking at time series data
** "Bin" data by day to generate the trend line
* Exporting and visualizing data
** Export dataset on edits over time
** Export dataset on articles over users
** Load data into Google Docs


In this project, we will build off the work in the lecture to begin to analyze data from Wikipedia. Once we've done that, we will extend this to code to create our own sub-datasets of Wikipedia edits or other data that we might be able to use to ask and answer questions!
We mostly worked on these questions in the afternoon:


=== Download and test the HPWP project ===
* More advanced counting
 
** Answer question: ''What are the most edited articles on Harry Potter?''
# Right click the following file, click "Save Target as..." or "Save link as...", and save it to your Desktop directory: http://mako.cc/teaching/2015/cdsw-autumn/harrypotter-wikipedia-cdsw.zip
*** Count the number of edits per articles
# The ".zip" extension on the above file indicates that it is a compressed Zip archive. We need to "extract" its contents.
** Answer question: ''Who are the most active editors on articles in Harry Potter?''
# Start up your terminal, navigate to the new directory you have unpacked called <code>harrypotter-wikipedia-cdsw.zip</code>.
*** Count the number of edits per user
 
=== Download a Dataset ===
 
There are two ways to download a dataset. You can either:
 
# Run the program <code>build_hpwp_dataset.py</code> which will download the code from the Wikipedia API. This will take 10 minutes or so.
# You can download a "pre-made" version I have run on my computer by doing the right-click, "Save link as..." approach for this URL: http://communitydata.cc/~mako/hp_wiki.tsv
 
=== Test Code ===
 
Once you have downloaded both code and the dataset, you can test it by running:
 
python hpwp-minor.py
 
This should output three lines and three numbers.
 
== Example programs ==
 
;<code>hpwp-minor.py</code>: This program aims to answer the question: ''What proportion of edits to Wikipedia Harry Potter articles are minor?''
 
;<code>hpwp-trend.py</code>: This program builds time series data by "binning" data by day to generate the trend line.
 
=== Coding Challenges ===
 
Coding Challenges
 
# Who are the 5 most active editors to articles in Wikipedia in Harry Potter? How may edits have they made?
# What are the most edited articles on Harry Potter on Wikipedia?
# Create graphs in a spreadsheet of the trend lines (i.e., edits per day over time) for the most active editor? How about one graph with the three most active editors?
# Create graphs in a spreadsheet of the trend lines (i.e., edits per day over time) for the three most popular articles?
# Instead of "binning" your dataset by day, change to bin it by month for each of the two previous questions.
# Pick a different topic in Wikipedia and download a new dataset. Answer the questions above for this other dataset.
 
[[Category:CDSW]]
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)