Not logged in
Talk
Contributions
Create account
Log in
Navigation
Main page
About
People
Publications
Teaching
Resources
Research Blog
Wiki Functions
Recent changes
Help
Licensing
Page
Discussion
Edit
View history
Editing
DS4UX (Spring 2016)/Panama Papers
(section)
From CommunityData
Jump to:
navigation
,
search
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.
Anti-spam check. Do
not
fill this in!
== Overview == In this project we will look at the viewing and editing history of a recently created Wikipedia article about a breaking news eventβ''[[w:Panama_Papers| Panama Papers]]''. When events of global significance occur, Wikipedia is often among the first places that people look for information about these events. By examining both the editing and viewing history of this article, we can learn a lot about how people create ''and'' consume information on Wikipedia. The process by which 'breaking news' articles are created on Wikipedia is [http://dgergle.soc.northwestern.edu/resources/KeeganGergleContractor_StayingInTheLoop_WikiSym2012.pdf a fascinating area of research] for data scientists who are study how humans work together. For more links to interesting research on Wikipedia, see the [[DS4UX_(Spring_2016)/Wikipedia_API#Research_using_Wikipedia_data|Resources section]] of this page. === Goals === * Understand the basic anatomy of an API request * Have fun collecting different types of data from Wikipedia * Practice reading API documentation * Pracice testing API queries in an [https://en.wikipedia.org/wiki/Special:ApiSandbox API Sandbox] * Practice reading and extending other people's code === Download and test the Panama Papers project === # Right click the following file, click "Save Target as..." or "Save link as...", and save it to your Desktop directory: https://jtmorgan.net/ds4ux/week6/panama-papers.zip # Find <code>panama-papers.zip</code> on your Desktop and double-click on it to "unzip" it. That will create a folder called <code>panama-papers</code> containing several files. # In PowerShell or Terminal, navigate to the <code>panama-papers</code> directory and type: python wikipedia-1.py at the command prompt to execute the <code>wikipedia-1.py</code> Python script. Wait a little while while your computer connects to Wikipedia. You should see the result of a query from Wikipedia API on your screen. If you don't, let Jonathan or Ray know . === About the APIs === ;Wikipedia Edit API: An API that provides data on edits to Wikipedia pages. Use the [https://en.wikipedia.org/wiki/Special:ApiSandbox API sandbox] to build and test queries with this API. * Also known as "the MediaWiki API", because it is the standard API for all sites that use [https://en.wikipedia.org/wiki/MediaWiki MediaWiki]. * You can use this API to edit Wikipedia, and do all sorts of other things. We will just be using [https://www.mediawiki.org/wiki/API:Query the Query module of the API] to gather data about individual pages and editors. * Example request for Panama Papers (current content of the page): https://en.wikipedia.org/w/api.php?format=json&action=query&titles=Panama_Papers&prop=revisions&rvprop=content ;Wikipedia Page View API: Use [https://wikimedia.org/api/rest_v1/?doc#!/Pageviews_data the (experimental!) Wikipedia page view API] to find out how many views a given Wikipedia article gets on a daily basis. * This API is a little different than the Wikipedia edit API because it uses relative paths (<code>/.../.../</code>) instead of parameters (<code>somekey=someval&otherkey=otherval</code>). * This API is case-sensitive, and space-sensitive (replace spaces in page titles with underscores). It also requires you to [http://www.w3schools.com/tags/ref_urlencode.asp URL encode] any special characters (like !, $, # and %) that might appear in a page title. * Example request for Panama Papers (page views 4/01 - 4/20): https://wikimedia.org/api/rest_v1/metrics/pageviews/per-article/en.wikipedia/all-access/user/Panama_Papers/daily/20160401/20160420
Summary:
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)
Tools
What links here
Related changes
Special pages
Page information