{"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

\u7ee7\u7eed\u9605\u8bfb<\/a><\/p>\n","protected":false},"author":18727,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[33],"class_list":["post-27273","post","type-post","status-publish","format-standard","hentry","category-software","tag-python","no-featured-image-padding"],"yoast_head":"\nPython \u56fe\u50cf\u8bf7\u6c42 - Cravatar \u5f00\u53d1\u6587\u6863<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/cravatar.com\/developer\/python-image-requests\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python \u56fe\u50cf\u8bf7\u6c42 - Cravatar \u5f00\u53d1\u6587\u6863\" \/>\n<meta property=\"og:description\" content=\"\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 ... \u7ee7\u7eed\u9605\u8bfb\" \/>\n<meta property=\"og:url\" content=\"https:\/\/cravatar.com\/developer\/python-image-requests\" \/>\n<meta property=\"og:site_name\" content=\"Cravatar \u5f00\u53d1\u6587\u6863\" \/>\n<meta property=\"article:published_time\" content=\"2023-08-15T03:35:51+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-08-15T04:08:27+00:00\" \/>\n<meta name=\"author\" content=\"\u8bd7\u8bed\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u8bd7\u8bed\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/cravatar.com\/developer\/python-image-requests#article\",\"isPartOf\":{\"@id\":\"https:\/\/cravatar.com\/developer\/python-image-requests\"},\"author\":{\"name\":\"\u8bd7\u8bed\",\"@id\":\"https:\/\/cravatar.com\/developer\/#\/schema\/person\/926f4cd5225ed8083a2075f3226065c2\"},\"headline\":\"Python \u56fe\u50cf\u8bf7\u6c42\",\"datePublished\":\"2023-08-15T03:35:51+00:00\",\"dateModified\":\"2023-08-15T04:08:27+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/cravatar.com\/developer\/python-image-requests\"},\"wordCount\":5,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/cravatar.com\/developer\/#organization\"},\"keywords\":[\"Python\"],\"articleSection\":[\"\u81ea\u5b9a\u4e49\u7a0b\u5e8f\"],\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/cravatar.com\/developer\/python-image-requests#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/cravatar.com\/developer\/python-image-requests\",\"url\":\"https:\/\/cravatar.com\/developer\/python-image-requests\",\"name\":\"Python \u56fe\u50cf\u8bf7\u6c42 - Cravatar \u5f00\u53d1\u6587\u6863\",\"isPartOf\":{\"@id\":\"https:\/\/cravatar.com\/developer\/#website\"},\"datePublished\":\"2023-08-15T03:35:51+00:00\",\"dateModified\":\"2023-08-15T04:08:27+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/cravatar.com\/developer\/python-image-requests#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/cravatar.com\/developer\/python-image-requests\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/cravatar.com\/developer\/python-image-requests#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/cravatar.com\/developer\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Python \u56fe\u50cf\u8bf7\u6c42\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/cravatar.com\/developer\/#website\",\"url\":\"https:\/\/cravatar.com\/developer\/\",\"name\":\"Cravatar \u5f00\u53d1\u6587\u6863\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/cravatar.com\/developer\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/cravatar.com\/developer\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/cravatar.com\/developer\/#organization\",\"name\":\"Cravatar \u5f00\u53d1\u6587\u6863\",\"url\":\"https:\/\/cravatar.com\/developer\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/cravatar.com\/developer\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/cravatar.com\/developer\/wp-content\/uploads\/sites\/18\/2023\/08\/cr-logo-02.png\",\"contentUrl\":\"https:\/\/cravatar.com\/developer\/wp-content\/uploads\/sites\/18\/2023\/08\/cr-logo-02.png\",\"width\":870,\"height\":225,\"caption\":\"Cravatar \u5f00\u53d1\u6587\u6863\"},\"image\":{\"@id\":\"https:\/\/cravatar.com\/developer\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/cravatar.com\/developer\/#\/schema\/person\/926f4cd5225ed8083a2075f3226065c2\",\"name\":\"\u8bd7\u8bed\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/cravatar.com\/developer\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/cravatar.com\/avatar\/60f1c4f099fc44da2978d9107535f58e?s=96&r=g&cache-key=60f1c4f099fc44da2978d9107535f58e\",\"contentUrl\":\"https:\/\/cravatar.com\/avatar\/60f1c4f099fc44da2978d9107535f58e?s=96&r=g&cache-key=60f1c4f099fc44da2978d9107535f58e\",\"caption\":\"\u8bd7\u8bed\"},\"sameAs\":[\"https:\/\/www.feibisi.com\/\"],\"url\":\"https:\/\/cravatar.com\/developer\/author\/feibisi\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Python \u56fe\u50cf\u8bf7\u6c42 - Cravatar \u5f00\u53d1\u6587\u6863","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/cravatar.com\/developer\/python-image-requests","og_locale":"zh_CN","og_type":"article","og_title":"Python \u56fe\u50cf\u8bf7\u6c42 - Cravatar \u5f00\u53d1\u6587\u6863","og_description":"\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 ... \u7ee7\u7eed\u9605\u8bfb","og_url":"https:\/\/cravatar.com\/developer\/python-image-requests","og_site_name":"Cravatar \u5f00\u53d1\u6587\u6863","article_published_time":"2023-08-15T03:35:51+00:00","article_modified_time":"2023-08-15T04:08:27+00:00","author":"\u8bd7\u8bed","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u8bd7\u8bed"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/cravatar.com\/developer\/python-image-requests#article","isPartOf":{"@id":"https:\/\/cravatar.com\/developer\/python-image-requests"},"author":{"name":"\u8bd7\u8bed","@id":"https:\/\/cravatar.com\/developer\/#\/schema\/person\/926f4cd5225ed8083a2075f3226065c2"},"headline":"Python \u56fe\u50cf\u8bf7\u6c42","datePublished":"2023-08-15T03:35:51+00:00","dateModified":"2023-08-15T04:08:27+00:00","mainEntityOfPage":{"@id":"https:\/\/cravatar.com\/developer\/python-image-requests"},"wordCount":5,"commentCount":0,"publisher":{"@id":"https:\/\/cravatar.com\/developer\/#organization"},"keywords":["Python"],"articleSection":["\u81ea\u5b9a\u4e49\u7a0b\u5e8f"],"inLanguage":"zh-Hans","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/cravatar.com\/developer\/python-image-requests#respond"]}]},{"@type":"WebPage","@id":"https:\/\/cravatar.com\/developer\/python-image-requests","url":"https:\/\/cravatar.com\/developer\/python-image-requests","name":"Python \u56fe\u50cf\u8bf7\u6c42 - Cravatar \u5f00\u53d1\u6587\u6863","isPartOf":{"@id":"https:\/\/cravatar.com\/developer\/#website"},"datePublished":"2023-08-15T03:35:51+00:00","dateModified":"2023-08-15T04:08:27+00:00","breadcrumb":{"@id":"https:\/\/cravatar.com\/developer\/python-image-requests#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/cravatar.com\/developer\/python-image-requests"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/cravatar.com\/developer\/python-image-requests#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/cravatar.com\/developer\/"},{"@type":"ListItem","position":2,"name":"Python \u56fe\u50cf\u8bf7\u6c42"}]},{"@type":"WebSite","@id":"https:\/\/cravatar.com\/developer\/#website","url":"https:\/\/cravatar.com\/developer\/","name":"Cravatar \u5f00\u53d1\u6587\u6863","description":"","publisher":{"@id":"https:\/\/cravatar.com\/developer\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/cravatar.com\/developer\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"zh-Hans"},{"@type":"Organization","@id":"https:\/\/cravatar.com\/developer\/#organization","name":"Cravatar \u5f00\u53d1\u6587\u6863","url":"https:\/\/cravatar.com\/developer\/","logo":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/cravatar.com\/developer\/#\/schema\/logo\/image\/","url":"https:\/\/cravatar.com\/developer\/wp-content\/uploads\/sites\/18\/2023\/08\/cr-logo-02.png","contentUrl":"https:\/\/cravatar.com\/developer\/wp-content\/uploads\/sites\/18\/2023\/08\/cr-logo-02.png","width":870,"height":225,"caption":"Cravatar \u5f00\u53d1\u6587\u6863"},"image":{"@id":"https:\/\/cravatar.com\/developer\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/cravatar.com\/developer\/#\/schema\/person\/926f4cd5225ed8083a2075f3226065c2","name":"\u8bd7\u8bed","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/cravatar.com\/developer\/#\/schema\/person\/image\/","url":"https:\/\/cravatar.com\/avatar\/60f1c4f099fc44da2978d9107535f58e?s=96&r=g&cache-key=60f1c4f099fc44da2978d9107535f58e","contentUrl":"https:\/\/cravatar.com\/avatar\/60f1c4f099fc44da2978d9107535f58e?s=96&r=g&cache-key=60f1c4f099fc44da2978d9107535f58e","caption":"\u8bd7\u8bed"},"sameAs":["https:\/\/www.feibisi.com\/"],"url":"https:\/\/cravatar.com\/developer\/author\/feibisi"}]}},"_links":{"self":[{"href":"https:\/\/cravatar.com\/developer\/wp-json\/wp\/v2\/posts\/27273","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cravatar.com\/developer\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cravatar.com\/developer\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cravatar.com\/developer\/wp-json\/wp\/v2\/users\/18727"}],"replies":[{"embeddable":true,"href":"https:\/\/cravatar.com\/developer\/wp-json\/wp\/v2\/comments?post=27273"}],"version-history":[{"count":0,"href":"https:\/\/cravatar.com\/developer\/wp-json\/wp\/v2\/posts\/27273\/revisions"}],"wp:attachment":[{"href":"https:\/\/cravatar.com\/developer\/wp-json\/wp\/v2\/media?parent=27273"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cravatar.com\/developer\/wp-json\/wp\/v2\/categories?post=27273"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cravatar.com\/developer\/wp-json\/wp\/v2\/tags?post=27273"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}