Author of wikipedia images

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Author of wikipedia images

Trung Dinh
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_Obama.jpg and the author of the image is Pete Souza<https://en.wikipedia.org/wiki/Pete_Souza>.

Thanks!

Trung
_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Author of wikipedia images

Bryan Davis
On Tue, Jul 11, 2017 at 10:40 PM, Trung Dinh <[hidden email]> 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_Obama.jpg and the author of the image is Pete Souza<https://en.wikipedia.org/wiki/Pete_Souza>.

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    <[hidden email]>
[[m:User:BDavis_(WMF)]] Manager, Cloud Services          Boise, ID USA
irc: bd808                                        v:415.839.6885 x6855

_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Loading...