As an example: The following query: http://en.wikipedia.org/w/api.php?action=opensearch&search=Berlin&fo... returns 10 results, one of them: <Item> <Text xml:space="preserve">Berlin S-Bahn</Text> <Description xml:space="preserve">The Berlin S-Bahn is a rapid transit system operated by S-Bahn Berlin GmbH, a subsidiary of the Deutsche Bahn. </Description> <Url xml:space="preserve">http://en.wikipedia.org/wiki/Berlin_S-Bahn</Url> <Image source="http://upload.wikimedia.org/wikipedia/commons/thumb/e/e7/S-Bahn-Logo.svg/50px-S-Bahn-Logo.svg.png" width="50" height="50" /> </Item>
has the aforementioned image tag.
I'm guessing whatever's showing you these images is using some heuristic like finding the first image on the page and showing you that.
I think so as well. I can confirm though that it is not always returning the first image on a page. Furthermore there are some pages with images, that do not return image tags in the corresponding opensearch result.
I would be interested in taking a look at the code that is generating the image tags in the opensearch results, but I have absolutly no idea where I should search for the code.
Best Mad_Chom
2010/4/14 Madam Chomsky <madamchomsky at yahoo.de>:
Hi Hope I am posting to the correct list.
I am doing an opensearch query via the api (http://en.wikipedia.org/w/api.php?action=opensearch&search=Te). Some search results come with a tiny thumbnail image link. I would like to know if the thumbnails are defined when someone is creating a wikipedia page or if there is some kind of algorithm that automatically creates these thumbnails. Would be glad about any information about this matter.
The opensearch result itself just contains page titles, no images. I'm guessing whatever's showing you these images is using some heuristic like finding the first image on the page and showing you that.
Roan Kattouw (Catrope)
2010/4/23 Madam Chomsky madamchomsky@yahoo.de:
I would be interested in taking a look at the code that is generating the image tags in the opensearch results, but I have absolutly no idea where I should search for the code.
The OpenSearchXml extension is the entry point for action=opensearch&format=xml requests.
Roan Kattouw (Catrope)
mediawiki-api@lists.wikimedia.org