{"id":27273,"date":"2023-08-15T11:35:51","date_gmt":"2023-08-15T03:35:51","guid":{"rendered":"https:\/\/cravatar.com\/developer\/?p=27273"},"modified":"2023-08-15T12:08:27","modified_gmt":"2023-08-15T04:08:27","slug":"python-image-requests","status":"publish","type":"post","link":"https:\/\/cravatar.com\/developer\/python-image-requests","title":{"rendered":"Python \u56fe\u50cf\u8bf7\u6c42"},"content":{"rendered":"\n
# import code for encoding urls and generating md5 hashes\nimport urllib, hashlib\n \n# Set your variables here\nemail = "someone@somewhere.com"\ndefault = "https:\/\/www.example.com\/default.jpg"\nsize = 40\n \n# construct the url\ncravatar_url = "https:\/\/cravatar.cn\/avatar\/" + hashlib.md5(email.lower()).hexdigest() + "?"\ncravatar_url += urllib.urlencode({'d':default, 's':str(size)})<\/code><\/pre>\n\n\n\n<\/p>\n\n\n\n
\u5982\u679c\u60a8\u4f7f\u7528 Python 3\uff0c\u8bf7\u5c1d\u8bd5 libgravatar<\/a> (\u8c03\u6574\u4e3a libcravatar \u5373\u53ef)\u3002\u8fd9\u662f\u7b2c\u4e09\u65b9\u5e93\uff0c\u4e0d\u53d7 Cravatar \u5b98\u65b9\u652f\u6301\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5982\u679c\u60a8\u4f7f\u7528 Python 3\uff0c\u8bf7\u5c1d\u8bd5 libgravatar (\u8c03\u6574\u4e3a libcravatar \u5373\u53ef)\u3002\u8fd9\u662f\u7b2c\u4e09\u65b9\u5e93\uff0c\u4e0d\u53d7 Cra ... <\/p>\n