Skip to content

Instantly share code, notes, and snippets.

@akfreas
akfreas / gist:5054929
Created February 28, 2013 07:26
Grabs profile pictures of a person/place/thing from Wikipedia. This function will check for all images associated with an article's title and compare those images against the images inside the infobox (typically the box on the top right hand corner of an article), returning the WikiMedia URLs of the images inside the infobox.
def figure_wikipedia_pic(figure_name, image_size):
wiki_images_get = requests.get("http://en.wikipedia.org/w/api.php?format=json&action=query&titles=%s&prop=images" % figure_name)
wiki_json = wiki_images_get.json()
wiki_page_json = requests.get("http://en.wikipedia.org/w/api.php?format=json&action=query&titles=%s&prop=revisions&rvprop=content&rvsection=0" % figure_name).json()
wiki_page_json = str(wiki_page_json)
@akfreas
akfreas / ipin.py
Created November 2, 2012 07:13 — forked from shinyzhu/ipin.py
iPIN - iPhone PNG Images Normalizer
#---
# iPIN - iPhone PNG Images Normalizer v1.0
# Copyright (C) 2007, 2012
#
# Author:
# Alexander Freas
# www.sashimiblade.com
# [email protected]
#
#