[Commons-l] Commons API

Bryan Tong Minh bryan.tongminh at gmail.com
Mon Mar 31 13:57:07 UTC 2008


On Mon, Mar 31, 2008 at 3:31 PM, Magnus Manske
<magnusmanske at googlemail.com> wrote:
> Ignoring all that careful planning ;-) I hacked a simple API:
>  http://tools.wikimedia.de/~magnus/commonsapi.php
>  http://tools.wikimedia.de/~magnus/commonsapi.php?image=Sa-warthog.jpg
>
>  For an image, it returns an XML text with
>  * URL of page and file
>  * qualityimage/features image status
>  * the components of the {{Infobox}} parts
>  * a list of descriptions in all available languages
>  * a list of categories
>  * a list of licenses (which for now are categories that fall in a
>  certain pattern)
>  * a simplified upload log
>
>  It's probably full of bugs, and not very elegant; I'm screenscraping
>  the page even for things like categories, which could be taken much
>  better from a separate MediaWiki API call. It's also missing
>  information (like file type, size, etc.) that can be retrieved through
>  our normal API.
>
>  Future enhancements could also include attributes per license (link to
>  original license text and logo, need to print the license, mention the
>  author, use the same license again etc.).
>
>  Cheers,
>  Magnus
>
>
>
>  _______________________________________________
>  Commons-l mailing list
>  Commons-l at lists.wikimedia.org
>  https://lists.wikimedia.org/mailman/listinfo/commons-l
>

You'll need an xml escape function, not an url escape one ;)



More information about the Commons-l mailing list