User:Siznax/wp image.py

From Wikimedia Commons, the free media repository
Jump to: navigation, search

wp_image.py[edit]

look for a Wikimedia Image/File

Usage:

$ python wp_image.py "Image:Neuromancer (Book).jpg" en
http://upload.wikimedia.org/wikipedia/en/4/4b/Neuromancer_(Book).jpg
200 OK
$ python wp_image.py "name_of_file_that_does_not_exist.jpg"
http://upload.wikimedia.org/wikipedia/commons/4/4e/name_of_file_that_does_not_exist.jpg
404 Not Found

(python) source code: https://github.com/siznax/wp/blob/master/wp_image.py