Page MenuHomePhabricator

Better API for Picture of the Day
Closed, DeclinedPublic


Author: bugzilla

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:

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:

And parse the unstructured items by hand to get the titles, and further:

To get the thumbnail and file URLs (I haven't figured out how to get those details for multiple files yet).

Version: unspecified
Severity: normal



Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 2:57 AM
bzimport set Reference to bz61956.
bzimport added a subscriber: Unknown Object (MLST).

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 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]


Steinsplitter moved this task from Uploading to Backlog on the Commons board.

CC'ing @Spage as he's interested in seeing a potential implementation of this. :)

I also contacted the original reporter of this ticket (from Bugzilla times) via email, asking whether the last reply by JeanFred was helpful.

Yup, that talks about the featuredfeed action API provided by Extension:FeaturedFeeds. The problem is the RSS feed is not the greatest format to discover the picture of the day and get its data. I'm not sure myself how to do it from JavaScript.

Another approach is to ask for the templates that commons Picture of the Day uses to ease the administration of a picture of the day, which is basically what the submitter is doing.

Well given that from a MW prespective, the picture of the day isn't really specially identified, there's not much for the api to do.

Perhaps if information about picture of the day was included in wikidata, it would be more sensical to get the info from the api.



This will often be out of date (It will reflect results as they were on the date the page_links_updated field in db is set to. That field isn't even shown in the info prop of the api though).

Well there isn't exactly a great way to get this data, I think the best out of all the choices would be to tell the user to determine the day they want the featured picture in YYYY-MM-DD format, and then use:|user|mime|extmetadata
replacing 2015-08-02 with the date they want. (The biggest downside is its fragile in that it assumes commons doesn't change their templates)