Last modified: 2014-02-26 19:19:20 UTC
I'm trying to create a Grilo[1] source for the Wiki Commons Picture of the day. Ideally, the API server side would look at bit like the one used by the Guardian: http://explorer.content.guardianapis.com/#/search?tag=world%2Fseries%2Feyewitness%2Ctype%2Fpicture&show-fields=all This shows me separate fields for each interesting bits of metadata (title, author, publication date, thumbnail URL, etc.) In contrast to the Wikimedia API which requires me to do something like: https://commons.wikimedia.org/wiki/Special:ApiSandbox#action=expandtemplates&format=json&text=%3Citem%3E%3Cfilename%3E%7B%7BTemplate%3APotd%2F2014-02-03%7D%7D%3C%2Ffilename%3E%20%3Ctitle%3E%7B%7BTemplate%3APotd%2F2014-02-03_(en)%7D%7D%3C%2Ftitle%3E%3C%2Fitem%3E%20%3Citem%3E%3Cfilename%3E%7B%7BTemplate%3APotd%2F2014-02-02%7D%7D%3C%2Ffilename%3E%20%3Ctitle%3E%7B%7BTemplate%3APotd%2F2014-02-02_(en)%7D%7D%3C%2Ftitle%3E%3C%2Fitem%3E And parse the unstructured items by hand to get the titles, and further: https://commons.wikimedia.org/wiki/Special:ApiSandbox#action=query&prop=imageinfo&format=json&iiprop=timestamp%7Cuser%7Cuserid%7Ccomment%7Cparsedcomment%7Ccanonicaltitle%7Curl%7Csize%7Cdimensions%7Csha1%7Cmime%7Cthumbmime%7Cmediatype%7Cmetadata%7Ccommonmetadata%7Cextmetadata%7Carchivename%7Cbitdepth%7Cuploadwarning&iilimit=1&titles=File%3ANickel_electrolytic_and_1cm3_cube.jpg To get the thumbnail and file URLs (I haven't figured out how to get those details for multiple files yet).
[1]: https://wiki.gnome.org/Projects/Grilo
The core MediaWiki API is concerned with accessing data provided by MediaWiki, not with taking wiki pages and trying to extract structured data from their content. You could use the tool someone has created at http://tools.wmflabs.org/potd-feed/potd.php to fetch relevant metadata. The developer of that tool would probably be willing to work with you. Or you could try to convince the communities on Commons and other wikis with PotDs to somehow make this data available in a more structured manner. What that manner might be I don't know. Maybe it would involve Wikidata. Or you could write a MediaWiki extension that manages structured data related to the PotD and exposes it via an API module, and then get it deployed on WMF wikis, and then convince the communities Commons and other wikis with PotDs to change their stuff to use your extension. Or, more generically, you might pursue some method for embedding/associating structured data in/with wiki pages. There may even be people working on this sort of thing already. Again, Wikidata might well be this. In any case, as filed against MediaWiki API this bug isn't going to be fixed, and it's not clear to me where it might be reassigned to, so I'm going to close it as WONTFIX. If someone wants to reassign it to some other component where it would be fixable, I encourage them to do so and reopen it.
Just throwing some pointers: *FeaturedFeeds [1] is enabled on Commons − would that help you here? *We do have some machine-readable data on Commons, see [2] [1] https://www.mediawiki.org/wiki/Extension:FeaturedFeeds [2] https://commons.wikimedia.org/wiki/Commons:Machine-readable_data