User:Kaldari/Task 1

For this task, you'll probably want to install MediaWiki on your local machine.

Write a PHP program that takes the following as query string parameters: Using these 3 parameters, your program should answer the question "In the category X, what were the X most-edited articles in the past X days, and how many times were each of them edited during that period." Output the results as JSON. Don't worry about subcategories.
 * The name of a MediaWiki category (for example '2013_films')
 * The number of articles to list
 * The number of days to evaluate (up to 10)

Hints: The recentchanges table stores all edits made in the past 13 weeks. The categorylinks table stores category membership. The page table stores the titles of articles.

The code should be a stand-alone PHP program that accesses the MediaWiki database directly, not a MediaWiki extension or maintenance script.

Code checked into github is ideal.