流程
- 注册账号,上传头像
- https://secure.gravatar.com/avatar/<邮箱的md5> 就可以获取到头像
参数
例子flasky git reset --hard 10c
def gravatar(self, size=100, default='identicon', rating='g'):
url = 'https://secure.gravatar.com/avatar'
hash = hashlib.md5(self.email.lower().encode('utf-8')).hexdigest()
return '{url}/{hash}?s={size}&d={default}&r={rating}'.format(
url=url, hash=hash, size=size, default=default, rating=rating)