Given a Wikimedia Commons description page URL - such as:
https://commons.wikimedia.org/wiki/File:Van_Gogh_-_Starry_Night_-_Google_Art_Project.jpg
I would like to be able to programmatically retrieve the information in the
Summary header. (Values for Artist, Title, Date, Medium,
Dimensions,
Hoi,
The good news is that work on the Wikidatafication of multimedia files
has started. You just provided an excellent example why it is so needed.
One drawback is that once it is done, your current work will need to be
revisited.
Thanks,
GerardM
On 3 June 2014 07:59, james harvey
I may have stumbled upon it. If I change the API call from
titles=File:XYZ.jpg to titles=Template:XYZ (note: dropped the .jpg)
then it *appears* to get me what I need.
Is this correct, or did I run across a case where it appears to work but
isn't going to be the right way to go? (Like, I'm not
Sorry for the email spam. Worked through it, I think. Not too familiar
with wiki internals. :-)
This particular page doesn't have the content I'm looking for in it. It
references a template which is used by a few other versions of the same
image, presumably so the data can be stored once and
Actually, what you really seem to want is to make use of
iiprop=extmetadata, which is an API that makes use of
https://commons.wikimedia.org/wiki/Commons:Machine-readable_data
included in the various templates. The MultimediaViewer project also
uses this API.
The link Derk-Jan mentioned is a great resource indeed.
However consumption of that data (mostly HTML structures) isn't very straight
forward in most programming languages.
A tool has been written to, until we have a better way in the MediaWIki
software, expose this information: