opexxx

gravatr.py

Nov 25th, 2013
312
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.38 KB | None | 0 0
  1. # import code for encoding urls and generating md5 hashes
  2. import urllib, hashlib
  3.  
  4. # Set your variables here
  5. default = "http://www.example.com/default.jpg"
  6. size = 40
  7.  
  8. # construct the url
  9. gravatar_url = "http://www.gravatar.com/avatar/" + hashlib.md5(email.lower()).hexdigest() + "?"
  10. gravatar_url += urllib.urlencode({'d':default, 's':str(size)})
Advertisement
Add Comment
Please, Sign In to add comment