On Tue, Jul 11, 2017 at 10:40 PM, Trung Dinh <trd(a)fb.com> wrote:
Hi everyone,
How can we programmatically (or from the data dump) get the author of the main image
shown in a Wikipedia article. For example, the image for Barrack Obama page is
https://en.wikipedia.org/wiki/Barack_Obama#/media/File:President_Barack_Oba… and the
author of the image is Pete
Souza<https://en.wikipedia.org/wiki/Pete_Souza>za>.
Try action=query&prop=imageinfo:
<https://en.wikipedia.org/wiki/Special:ApiSandbox#action=query&format=json&prop=imageinfo&titles=File%3APresident_Barack_Obama.jpg&formatversion=2&iiprop=user%7Ccanonicaltitle%7Curl%7Ccommonmetadata&iilimit=1>
This is what MultimediaViewer uses behind the scenes to describe the
image when shown in lightbox mode:
<https://phabricator.wikimedia.org/diffusion/EMMV/browse/master/resources/mmv/provider/mmv.provider.ImageInfo.js>
Bryan
--
Bryan Davis Wikimedia Foundation <bd808(a)wikimedia.org>
[[m:User:BDavis_(WMF)]] Manager, Cloud Services Boise, ID USA
irc: bd808 v:415.839.6885 x6855