Created
June 10, 2012 07:57
-
-
Save yosida95/2904431 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_gravatar(mailaddress): | |
from urllib import urlencode | |
from hashlib import md5 | |
from urlparse import urlunparse | |
_query_string = urlencode({ | |
'd': DEFAULT_USER_ICON, 's': 160 | |
}) | |
call_api_addr = [ | |
'http', 'www.gravatar.com', | |
'/avatar/%s' % (md5(mailaddress).hexdigest()), '', _query_string, '' | |
] | |
return urlunparse(call_api_addr) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment