thanks
From: mediawiki-api-bounces@lists.wikimedia.org [mailto:mediawiki-api-bounces@lists.wikimedia.org] On Behalf Of Ricordisamoa Sent: Thursday, January 22, 2015 11:21 AM To: mediawiki-api@lists.wikimedia.org Subject: Re: [Mediawiki-api] Wikipedia image
You can pass the "pithumbsize" argument to the pageimages API with the desired size. However, it looks like there's no way to retrieve the original size used on the page.
Il 22/01/2015 19:30, practikalmind ha scritto:
Thanks, would that mean I would need to make 2 calls?
From: mediawiki-api-bounces@lists.wikimedia.org mailto:mediawiki-api-bounces@lists.wikimedia.org [mailto:mediawiki-api-bounces@lists.wikimedia.org] On Behalf Of Alex Monk Sent: Thursday, January 22, 2015 9:56 AM To: MediaWiki API announcements & discussion Subject: Re: [Mediawiki-api] Wikipedia image
You did actually specify a thumbnail link in your previous email so I assumed that would be okay. It should be possible to take the pageimage value and use a query like https://en.wikipedia.org/w/api.php?action=query https://en.wikipedia.org/w/api.php?action=query&prop=imageinfo&iiprop=url&titles=File:Steve_Jobs_Headshot_2010-CROP.jpg &prop=imageinfo&iiprop=url&titles=File:Steve_Jobs_Headshot_2010-CROP.jpg to get the URL you want.
On 22 January 2015 at 17:42, practikalmind <practikalmind@gmail.com mailto:practikalmind@gmail.com > wrote:
https://en.wikipedia.org/w/api.php?action=query https://en.wikipedia.org/w/api.php?action=query&titles=Steve%20Jobs&prop=pageimages &titles=Steve%20Jobs&prop=pageimages
thanks, but I get the thumbnail image https://upload.wikimedia.org/wikipedia/commons/thumb/b/b9/Steve_Jobs_Headshot_2010-CROP.jpg/50px-Steve_Jobs_Headshot_2010-CROP.jpg as opposed to the bigger image on the Steve Jobs wikipedia page. Please let me know if there is a way to get the bigger image.
"warnings": {
"query": {
"*": "Formatting of continuation data will be changing soon. To continue using the current formatting, use the 'rawcontinue' parameter. To begin using the new format, pass an empty string for 'continue' in the initial query."
}
},
"query": {
"pages": {
"7412236": {
"pageid": 7412236,
"ns": 0,
"title": "Steve Jobs",
"thumbnail": {
"source": "https://upload.wikimedia.org/wikipedia/commons/thumb/b/b9/Steve_Jobs_Headsho...",
"width": 50,
"height": 49
},
"pageimage": "Steve_Jobs_Headshot_2010-CROP.jpg"
}
}
}
}
From: mediawiki-api-bounces@lists.wikimedia.org mailto:mediawiki-api-bounces@lists.wikimedia.org [mailto:mediawiki-api-bounces@lists.wikimedia.org mailto:mediawiki-api-bounces@lists.wikimedia.org ] On Behalf Of Alex Monk Sent: Thursday, January 22, 2015 7:26 AM To: MediaWiki API announcements & discussion Subject: Re: [Mediawiki-api] Wikipedia image
https://www.mediawiki.org/wiki/Extension:PageImages does this
https://en.wikipedia.org/w/api.php?action=query https://en.wikipedia.org/w/api.php?action=query&prop=pageimages&titles=Steve_Jobs &prop=pageimages&titles=Steve_Jobs
On 22 January 2015 at 15:23, practikalmind <practikalmind@gmail.com mailto:practikalmind@gmail.com > wrote:
Hi,
What is the best way to get the main image of a wiki page? For example, I would like to retrieve
http://upload.wikimedia.org/wikipedia/commons/thumb/b/b9/Steve_Jobs_Headshot... for the Steve Jobs wiki page http://en.wikipedia.org/wiki/Steve_Jobs .
thanks
_______________________________________________ Mediawiki-api mailing list Mediawiki-api@lists.wikimedia.org mailto:Mediawiki-api@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
_______________________________________________ Mediawiki-api mailing list Mediawiki-api@lists.wikimedia.org mailto:Mediawiki-api@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
_______________________________________________ Mediawiki-api mailing list Mediawiki-api@lists.wikimedia.org mailto:Mediawiki-api@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-api