Added the ability to specify size when fetching a gravatar URL.

This commit is contained in:
Adam Waldenberg 2013-07-24 08:26:40 +02:00
parent 329bb45947
commit 3ed1cf3618

View file

@ -21,13 +21,13 @@ import format
import hashlib
import urllib
def get_url(email):
def get_url(email, size=20):
md5hash = hashlib.md5(email.lower().strip()).hexdigest()
base_url = "http://www.gravatar.com/avatar/" + md5hash
params = None
if format.get_selected() == "html":
params = {"default": "identicon", "size": 20}
params = {"default": "identicon", "size": size}
elif format.get_selected() == "xml":
params = {"default": "identicon"}