As an aside I'm curious , how are you rendering the html from the wikitext ?
On Fri, Nov 15, 2013 at 2:07 PM, Thomas <thomas(a)thomaszander.se> wrote:
Hi,
I am writing a mobile client that can show wikipedia content. My approach
is to download the raw media-wiki markup instead of the generated html.
This allows me more control and I avoid using a html parser/viewer.
The approach is quite successful except for when I encounter images.
In the markup I can see something like;
File:1945-P-Jefferson-War-Nickel-Reverse.JPG
I use the API to fetch some metadata;
en.wikipedia.org/w/api.php?action=query&prop=imageinfo \
&iilimit=1&format=xml&iiprop=dimensions%7Cmime&titles=[foo]
The piece of the puzzle I am still missing is how to find out the actual
download URL for any given image.
I've seen images start with;
http://upload.wikimedia.org/wikipedia/en/6/6d/
and with;
http://upload.wikimedia.org/wikipedia/commons/d/d0/
But I don't really understand how to decide what url to prefix to my
image-name.
Anyone can shed some light on this?
Thanks!
--
Thomas Zander
_______________________________________________
Mediawiki-api mailing list
Mediawiki-api(a)lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api