Last active
September 25, 2015 02:41
-
-
Save alexdzul/64771f8278019ddeb3ab to your computer and use it in GitHub Desktop.
Obteniendo url de imagen gravatar desde Python
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
import hashlib | |
def get_url_gravatar(email): | |
""" | |
Obtenemos la url del gravatar del email que se nos proporcione. | |
""" | |
m = hashlib.md5() | |
m.update(email.encode('utf-8')) | |
url = "http://www.gravatar.com/avatar/{0}.jpg?s=300".format(m.hexdigest()) | |
return url |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment