Community Data Science Workshops (Spring 2015)/Day 2 Projects/Wikipedia: Difference between revisions
From CommunityData
(Creating from the 2014 Wikipedia project page.) |
(cat) |
||
(6 intermediate revisions by 4 users not shown) | |||
Line 14: | Line 14: | ||
=== Download and test the Wikipedia project === | === Download and test the Wikipedia project === | ||
If you are confused by these steps, go back and refresh your memory with the [[Community Data Science Workshops ( | If you are confused by these steps, go back and refresh your memory with the [[Community Data Science Workshops (Spring 2015)/Day 0 setup and tutorial|Day 0 setup and tutorial]] and [[Community Data Science Workshops (Spring 2015)/Day 0 tutorial|Day 0 tutorial]] | ||
(Estimated time: 10 minutes) | (Estimated time: 10 minutes) | ||
* [[Community Data Science Workshops ( | * [[Community Data Science Workshops (Spring 2015)/Day 2 Projects/Wikipedia/Windows setup|Windows]] | ||
* [[Community Data Science Workshops ( | * [[Community Data Science Workshops (Spring 2015)/Day 2 Projects/Wikipedia/OS X setup|OS X]] | ||
=== Example topics | === Example topics we might cover in the lecture === | ||
* explain MediaWiki, exists on other wikis | * explain [http://www.mediawiki.org/wiki/API:Main_page MediaWiki], exists on other wikis | ||
* navigate to [http://en.wikipedia.org/w/api.php api page] and show the documentation, point out examples | * navigate to [http://en.wikipedia.org/w/api.php api page] and show the documentation, point out examples | ||
* introduce the [https://en.wikipedia.org/wiki/Special:ApiSandbox API sandbox] as a tool for building queries | * introduce the [https://en.wikipedia.org/wiki/Special:ApiSandbox API sandbox] as a tool for building queries | ||
* looking at the images within a page http://en.wikipedia.org/w/api.php?action=query&titles=Seattle&prop=images&imlimit=20&format=jsonfm | * looking at the images within a page http://en.wikipedia.org/w/api.php?action=query&titles=Seattle&prop=images&imlimit=20&format=jsonfm | ||
* change the city with a custom URL | * change the city with a custom URL | ||
* edit count http://en.wikipedia.org/w/api.php?action=query&list=users&ususers=Benjamin_Mako_Hill|Jtmorgan|Sj| | * edit count http://en.wikipedia.org/w/api.php?action=query&list=users&ususers=Benjamin_Mako_Hill|Jtmorgan|Sj|Koavf&usprop=editcount&format=jsonfm | ||
* get the content of the main page http://en.wikipedia.org/w/api.php?format=json&action=query&titles=Main%20Page&prop=revisions&rvprop=content | * get the content of the main page http://en.wikipedia.org/w/api.php?format=json&action=query&titles=Main%20Page&prop=revisions&rvprop=content | ||
=== Resources === | === Resources === | ||
Line 37: | Line 35: | ||
* [https://en.wikipedia.org/wiki/Special:ApiSandbox API Sandbox] | * [https://en.wikipedia.org/wiki/Special:ApiSandbox API Sandbox] | ||
* [[Sample API queries]] | * [[Sample API queries]] | ||
[[Category:Spring_2015_series]] |
Latest revision as of 01:15, 17 September 2015
Building a Dataset using the Wikipedia API[edit]
In this project, we will explore a few ways to gather data using the Wikipedia API. Once we've done that, we will extend this to code to create our own datasets of Wikipedia edits or other data that we might be able to use to ask and answer questions in the final session.
Goals[edit]
- Get set up to build datasets with the Wikipedia API
- Have fun collecting different types of data from Wikipedia
- Practice reading and extending other people's code
- Create a few collections of different types of data from Wikipedia that you can do research with in the final section
Download and test the Wikipedia project[edit]
If you are confused by these steps, go back and refresh your memory with the Day 0 setup and tutorial and Day 0 tutorial
(Estimated time: 10 minutes)
Example topics we might cover in the lecture[edit]
- explain MediaWiki, exists on other wikis
- navigate to api page and show the documentation, point out examples
- introduce the API sandbox as a tool for building queries
- looking at the images within a page http://en.wikipedia.org/w/api.php?action=query&titles=Seattle&prop=images&imlimit=20&format=jsonfm
- change the city with a custom URL
- edit count http://en.wikipedia.org/w/api.php?action=query&list=users&ususers=Benjamin_Mako_Hill%7CJtmorgan%7CSj%7CKoavf&usprop=editcount&format=jsonfm
- get the content of the main page http://en.wikipedia.org/w/api.php?format=json&action=query&titles=Main%20Page&prop=revisions&rvprop=content