Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # import code for encoding urls and generating md5 hashes
- import urllib, hashlib
- # Set your variables here
- email = "someone@somewhere.com"
- default = "http://www.example.com/default.jpg"
- size = 40
- # construct the url
- gravatar_url = "http://www.gravatar.com/avatar/" + hashlib.md5(email.lower()).hexdigest() + "?"
- gravatar_url += urllib.urlencode({'d':default, 's':str(size)})
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement