User:Kaldari/Task 1

Write a PHP program that takes the following as command-line or query string parameters: Using these 4 parameters, your program should answer the question "In the category X, what were the X most-edited articles between the days X and X, and how many times were each of them edited during that period." Don't worry about subcategories. The results should be output as JSON, along with the total time that the query or queries took to run.
 * The name of a MediaWiki category (for example 'Tropical_fruit')
 * The number of articles to list
 * A start date in ISO 8601 format (for example '2011-07-31')
 * An end date in ISO 8601 format (for example '2013-10-17')

Hints: The revision table stores all the edits. The categorylinks table stores category membership. The page table stores the titles of articles. MediaWiki stores timestamps in the format yyyymmddhhmmss.

The code should be a stand-alone PHP program that accesses the MediaWiki database directly, not a MediaWiki extension or maintenance script. Do not use any frameworks or PEAR packages, only plain PHP.

Code checked into GitHub is ideal.