If you know what articles there are for a given location, then you can
look up the images associated with the articles. e.g.
http://en.wikipedia.org/w/api.php?action=query&generator=images&tit…
You should get some JSON like this:
{
"query": {
"pages": {
"-1": {
"contentmodel": "wikitext",
"missing": "",
"ns": 6,
"pagelanguage": "en",
"title": "File:Auguste Rodin - Grubleren 2005-02.jpg"
},
"-2": {
"contentmodel": "wikitext",
"missing": "",
"ns": 6,
"pagelanguage": "en",
"title": "File:Flaming Sword by Matthew Bisanz.JPG"
},
"-3": {
"contentmodel": "wikitext",
"missing": "",
"ns": 6,
"pagelanguage": "en",
"title": "File:JEFraser 2ndDivMemorial.jpg"
}
}
}
}
I think you can follow these instructions [1] to figure out the URL
from a thumbnail. For example if you are looking for File:Flaming
Sword by Matthew Bisanz.JPG, you can calculate the md5 for the filename:
9a06f2a830f1a0b67c50df1e5b5a2a5c
and then use the first character, and then the first two characters to
construct a URL like this:
http://upload.wikimedia.org/wikipedia/commons/thumb/9/9a/Flaming_Sword_by_M…
You can adjust the pixel size as needed. The big assumption here is
that the images are directly relevant to the article...which may be
too big a leap, but it might be interesting to try it out.
//Ed
[1]
https://www.mediawiki.org/wiki/Manual:$wgHashedUploadDirectory
On Fri, Jun 21, 2013 at 7:01 PM, Jon Robson <jdlrobson(a)gmail.com> wrote:
I had a really cool idea of something to do today but
realised that
Commons has no geodata. How can we change this? (I'd expect to be able
to see nearby photos on
http://commons.wikimedia.org/w/index.php?title=Special:Nearby)
_______________________________________________
Mobile-l mailing list
Mobile-l(a)lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mobile-l