\u3053\u3061\u3089<\/a>\u304b\u3089 Gyazo API \u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u767b\u9332\u3092\u3057\u3066, \u30a2\u30af\u30bb\u30b9\u30c8\u30fc\u30af\u30f3\u3092\u53d6\u5f97\u3057\u3066\u304a\u304d\u307e\u3059.<\/p>\npython-gyazo \u306f PyPI \u304b\u3089\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u304d\u307e\u3059. Python 2.7 \u3068 Python 3.4 \u3067\u30c6\u30b9\u30c8\u3057\u3066\u3044\u307e\u3059. virtualenv \u3092\u4f7f\u3063\u305f\u5834\u5408\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u65b9\u6cd5\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059.<\/p>\n
\r\nvirtualenv venv\r\nsource venv\/bin\/activate\r\npip install python-gyazo\r\n<\/pre>\n\u753b\u50cf\u306e\u53d6\u5f97<\/h3>\n
\u81ea\u5206\u306e Gyazo \u306e\u753b\u50cf\u306e\u30ea\u30b9\u30c8\u3092\u53d6\u5f97\u3057\u3066, \u305d\u306e\u60c5\u5831\u3092\u8868\u793a\u3059\u308b\u4f8b\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059.
\ngyazo.Image.download \u3067\u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u306e\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3092, gyazo.Image.download_thumb \u3067\u30b5\u30e0\u30cd\u30a4\u30eb\u306e\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3092\u884c\u3048\u307e\u3059.<\/p>\n
\r\nfrom gyazo import Api\r\n\r\napi = Api(client_id='YOUR_CLIENT_ID',\r\n client_secret='YOUR_CLIENT_SECRET',\r\n access_token='YOUR_ACCESS_TOKEN')\r\n\r\n# Get image list\r\nimages = api.get_image_list()\r\nfor image in images:\r\n print(str(image))\r\n\r\n# Download image\r\nimage = images[0]\r\nif image.url:\r\n with open(image.filename, 'wb') as f:\r\n f.write(image.download())\r\n<\/pre>\n\u753b\u50cf\u306e\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9<\/h3>\n
sample.png \u3092\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3059\u308b\u4f8b\u306f\u4ee5\u4e0b\u306b\u306a\u308a\u307e\u3059.<\/p>\n
\r\nfrom gyazo import Api\r\n\r\napi = Api(client_id='YOUR_CLIENT_ID',\r\n client_secret='YOUR_CLIENT_SECRET',\r\n access_token='YOUR_ACCESS_TOKEN')\r\n\r\n# Upload image\r\nwith open('sample.png', 'rb') as f:\r\n image = api.upload_image(f)\r\n print(image.to_json())\r\n<\/pre>\n\u753b\u50cf\u306e\u524a\u9664<\/h3>\n
\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3057\u3066, \u7279\u5b9a\u306e\u753b\u50cf\u3092\u524a\u9664\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059.<\/p>\n
\r\nfrom gyazo import Api\r\n\r\napi = Api(client_id='YOUR_CLIENT_ID',\r\n client_secret='YOUR_CLIENT_SECRET',\r\n access_token='YOUR_ACCESS_TOKEN')\r\n\r\napi.delete_image('IMAGE_ID')\r\n<\/pre>\n\u4eca\u5f8c\u306e\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u4e88\u5b9a<\/h2>\n
\u73fe\u6642\u70b9\u3067 Gyazo API \u304c\u63d0\u4f9b\u3057\u3066\u3044\u308b\u6a5f\u80fd\u306e\u591a\u304f\u3092\u30b5\u30dd\u30fc\u30c8\u3057\u3066\u3044\u307e\u3059. Gyazo API \u306e\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u304c\u3042\u3063\u305f\u5834\u5408\u306f\u8ffd\u5f93\u3059\u308b\u4e88\u5b9a\u3067\u3059. python-gyazo \u3092\u5229\u7528\u3057\u3066, Gyazo API, Gyazo \u3092\u3055\u3089\u306b\u6d3b\u7528\u3057\u3066\u306f\u3044\u304b\u304c\u3067\u3057\u3087\u3046.<\/p>\n","protected":false},"excerpt":{"rendered":"
2014\/7\/24 \u306b Gyazo API \u304c\u516c\u958b\u3055\u308c\u307e\u3057\u305f. \u3053\u306e API \u3092 Python \u304b\u3089\u7c21\u5358\u306b\u5229\u7528\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u305f python-gyazo \u3092\u4f5c\u6210\u3057\u30ea\u30ea\u30fc\u30b9\u3057\u307e\u3057\u305f. \u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u306f GitHub \u3067\u516c\u958b\u3057 […]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26,18,3],"tags":[56,53,15],"_links":{"self":[{"href":"https:\/\/blog.ymyzk.com\/wp-json\/wp\/v2\/posts\/397"}],"collection":[{"href":"https:\/\/blog.ymyzk.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.ymyzk.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.ymyzk.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.ymyzk.com\/wp-json\/wp\/v2\/comments?post=397"}],"version-history":[{"count":9,"href":"https:\/\/blog.ymyzk.com\/wp-json\/wp\/v2\/posts\/397\/revisions"}],"predecessor-version":[{"id":634,"href":"https:\/\/blog.ymyzk.com\/wp-json\/wp\/v2\/posts\/397\/revisions\/634"}],"wp:attachment":[{"href":"https:\/\/blog.ymyzk.com\/wp-json\/wp\/v2\/media?parent=397"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.ymyzk.com\/wp-json\/wp\/v2\/categories?post=397"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.ymyzk.com\/wp-json\/wp\/v2\/tags?post=397"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}