On 07/02/2008, Richard Cyganiak <[EMAIL PROTECTED]> wrote:
>
> On 6 Feb 2008, at 03:23, Brianna Laugher wrote:
> > You could do this:
> > http://commons.wikimedia.org/w/thumb.php?w=200&f=Male-total.jpg
> >
> > This generates a 200px-width thumbnail. However I believe it
> > bypasses the cache, so it's not appropriate to use this to hotlink a
> > thumbnail. If you did it once per image to make the thumbnail and
> > then save it locally I think that would be OK.
> > Oh and I meant to say...
> > you may need to try doing that on en.wikipedia.org first and it that
> > doesn't work, then commons.wikimedia.org . I don't know that there's
> > an easy way to check if an image has been "really" uploaded to en.wp
> > or Commons, because images on Commons work transparently *as if*
> > they were on en.wp.
>
> Ok, we don't want to save the images locally, so I suppose it makes
> sense to keep our current behaviour for images (check in the en.wp
> database first; if it's not there assume it's in commons; construct
> the cached thumbnail URI by doing the md5 hash magic).

OK, you can do these things using the API:

<http://en.wikipedia.org/w/api.php?action=query&titles=Image:Albert%20Einstein%20Head.jpg&prop=imageinfo&iiprop=url&iiurlwidth=200>
gives you the URL of the thumbnail.

<http://en.wikipedia.org/w/api.php?action=query&titles=Image:Albert%20Einstein%20Head.jpg&prop=imageinfo>
shows you imagerepository="shared" or "local" so that tells you if the
image is at en.wikipedia or commons.

So yay for the API!

cheers,
Brianna

-- 
They've just been waiting in a mountain for the right moment:
http://modernthings.org/

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Dbpedia-discussion mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dbpedia-discussion

Reply via email to