{"id":7835,"date":"2017-02-14T15:00:52","date_gmt":"2017-02-14T06:00:52","guid":{"rendered":"http:\/\/sitest.jp\/blog\/?p=7835"},"modified":"2017-02-13T13:59:33","modified_gmt":"2017-02-13T04:59:33","slug":"google-apps-script%ef%bc%88gas%ef%bc%89%e3%81%a7%e7%b0%a1%e5%8d%98%e3%81%ab%e4%bd%9c%e3%82%8b%e3%82%b5%e3%83%bc%e3%83%90%e3%83%bc%e3%83%ac%e3%82%b9api","status":"publish","type":"post","link":"https:\/\/sitest.jp\/blog\/?p=7835","title":{"rendered":"Google Apps Script\uff08GAS\uff09\u3067\u7c21\u5358\u306b\u4f5c\u308b\u30b5\u30fc\u30d0\u30fc\u30ec\u30b9API"},"content":{"rendered":"<p>\u3053\u3093\u3061\u306b\u306f\u3001\u30d7\u30ed\u30c0\u30af\u30c8\u958b\u767a\u30c1\u30fc\u30e0\u306e\u7267\u3067\u3059\u3002<\/p>\n<p>\u6700\u8fd1\u3001\u30b5\u30fc\u30d0\u30fc\u30ec\u30b9\u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3\u304c\u71b1\u304f\u306a\u3063\u3066\u304d\u3066\u3044\u308b\u3068\u611f\u3058\u307e\u3059\u3002<br \/>\n\u308f\u3056\u308f\u3056API\u30b5\u30fc\u30d0\u30fc\u3092\u7acb\u3066\u308b\u5fc5\u8981\u306a\u304f\u3001\u30b3\u30fc\u30c9\u3092\u30c7\u30d7\u30ed\u30a4\u3059\u308b\u3060\u3051\u3067API\u30b5\u30fc\u30d0\u30fc\u3068\u3057\u3066\u5229\u7528\u3067\u304d\u307e\u3059\u3002<br \/>\n\u6709\u540d\u306a\u3082\u306e\u3067\u3059\u3068\u3001AWS Lambda\u3084Azure Functions\u3001Google\u306eCloud Functions\u306a\u3069\u3067\u30b5\u30fc\u30d3\u30b9\u63d0\u4f9b\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u4eca\u56de\u306f\u3001\u3082\u3063\u3068\u624b\u8efd\u306bGoogle Apps Script\u3060\u3051\u3067\u30b5\u30fc\u30d0\u30fc\u30ec\u30b9API\u3092\u4f5c\u308b\u65b9\u6cd5\u3092\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n<p><!--more--><\/p>\n<div class=\"frame_headding\">\n<h3 style=\"text-align: left;\">Google Apps Script\u3068\u306f<\/h3>\n<\/div>\n<p>Google Apps Script\u3068\u306fGoogle\u304c\u63d0\u4f9b\u3057\u3066\u3044\u308b\u30b5\u30fc\u30d3\u30b9\u306e\u4e00\u3064\u3067\u3059\u3002<br \/>\nJavaScript\u3067\u66f8\u304f\u3053\u3068\u304c\u3067\u304d\u3001\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u3084Google Drive\u306a\u3069\u3092\u7c21\u5358\u306b\u64cd\u4f5c\u3067\u304d\u308bAPI\u304c\u7528\u610f\u3055\u308c\u3066\u3044\u307e\u3059\u3002<br \/>\n\u30b9\u30b1\u30b8\u30e5\u30fc\u30ea\u30f3\u30b0\u3082\u3067\u304d\u308b\u306e\u3067\u3001Cron\u306e\u3088\u3046\u306b\u5b9a\u671f\u7684\u306b\u5b9f\u884c\u3059\u308b\u3053\u3068\u304c\u51fa\u6765\u307e\u3059\u3002<br \/>\n\u307e\u305f\u3001Google\u306e\u30b5\u30fc\u30d0\u4e0a\u3067\u52d5\u4f5c\u3057\u3066\u3044\u307e\u3059\u306e\u3067\u5b89\u5fc3\u611f\u3082\u629c\u7fa4\u3067\u3059\u3002<\/p>\n<div class=\"frame_headding\">\n<h3 style=\"text-align: left;\">\u5b9f\u969b\u306b\u4f5c\u3063\u3066\u307f\u3088\u3046<\/h3>\n<\/div>\n<p>\u4eca\u56de\u306f\u3001<a href=\"https:\/\/api.cdnjs.com\/\" target=\"_blank\" rel=\"nofollow\">cdnjs\u306eJSON API<\/a>\u3092\u4f7f\u3063\u3066JavaScript\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u63a2\u3059API\u3092\u4f5c\u308a\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<pre><code>function doGet(e) {\n  if(e.parameter.s){\n    param = e.parameter.s;\n  }else{\n    param = \"\";\n  }\n  var response = UrlFetchApp.fetch(\"https:\/\/api.cdnjs.com\/libraries?search=\" + param);\n  var output = ContentService.createTextOutput();\n  output.setMimeType(ContentService.MimeType.JSON);\n  output.setContent(response.getContentText());\n  return output;\n}\n<\/code><\/pre>\n<p>doGet\u95a2\u6570\u306fWebAPI\u3068\u3057\u3066\u516c\u958b\u3057\u305f\u6642\u306b\u3001<br \/>\nGET\u30e1\u30bd\u30c3\u30c9\u3067\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3068\u5b9f\u884c\u3055\u308c\u308b\u95a2\u6570\u3067\u3059\u3002<br \/>\nUrlFetchApp\u3092\u4f7f\u3063\u3066\u5916\u90e8API\u306b\u30a2\u30af\u30bb\u30b9\u3057\u3001\u53d6\u5f97\u3057\u305fJSON\u3092\u8fd4\u3059\u7c21\u5358\u306aAPI\u3067\u3059\u3002<br \/>\n\u30d1\u30e9\u30e1\u30fc\u30bf\u306bs=jquery\u306a\u3069\u3068\u8ffd\u52a0\u3057\u3066\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3068\u3001\u7d5e\u308a\u8fbc\u307f\u304c\u884c\u308f\u308c\u8a72\u5f53\u3057\u305fJavaScript\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u60c5\u5831\u304c\u5165\u3063\u3066\u3044\u308bJSON\u304c\u8fd4\u3063\u3066\u304d\u307e\u3059\u3002<\/p>\n<div class=\"frame_headding\">\n<h3 style=\"text-align: left;\">\u516c\u958b\u3057\u3066\u307f\u3088\u3046<\/h3>\n<\/div>\n<p>\u30b3\u30fc\u30c9\u304c\u66f8\u3051\u307e\u3057\u305f\u306e\u3067\u3001\u4eca\u5ea6\u306f\u4f5c\u3063\u305f\u30b3\u30fc\u30c9\u3092API\u3068\u3057\u3066\u516c\u958b\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<br \/>\n\u307e\u305a\u306f\u3001\u300c\u516c\u958b\u300d\u30bf\u30d6\u306e\u300c\u5b9f\u884c\u53ef\u80fdAPI\u3068\u3057\u3066\u5c0e\u5165\u300d\u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3057\u3087\u3046\u3002<br \/>\n<!-- img --><br \/>\n<a target=\"_blank\" href=\"https:\/\/storage.googleapis.com\/sitest-wp\/blog\/wp-content\/uploads\/2017\/01\/ExternalAPI_menu.png\"><img loading=\"lazy\" src=\"https:\/\/storage.googleapis.com\/sitest-wp\/blog\/wp-content\/uploads\/2017\/01\/ExternalAPI_menu.png\" alt=\"ExternalAPI_menu\" width=\"851\" height=\"377\" class=\"alignnone size-full wp-image-8000\" \/><\/a><br \/>\n\u4eca\u56de\u4f5c\u6210\u3057\u305f\u30b3\u30fc\u30c9\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u6c7a\u3081\u3066\u3001\u3069\u306e\u7bc4\u56f2\u307e\u3067\u516c\u958b\u3059\u308b\u306e\u304b\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<br \/>\n\u4eca\u56de\u306f\u6700\u521d\u306b\u4f5c\u3063\u3066\u3057\u307e\u3063\u3066\u3044\u305f\u306e\u3067\u300cv0.0.2\u300d\u3068\u3057\u3066\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u6253\u3061\u307e\u3057\u305f\u3002<br \/>\n<!-- img --><br \/>\n<a target=\"_blank\" href=\"https:\/\/storage.googleapis.com\/sitest-wp\/blog\/wp-content\/uploads\/2017\/01\/ExternalAPI.png\"><img loading=\"lazy\" src=\"https:\/\/storage.googleapis.com\/sitest-wp\/blog\/wp-content\/uploads\/2017\/01\/ExternalAPI.png\" alt=\"ExternalAPI\" width=\"495\" height=\"505\" class=\"alignnone size-full wp-image-8001\" \/><\/a><\/p>\n<p>\u6b21\u306b\u3001\u300c\u516c\u958b\u300d\u30bf\u30d6\u306e\u300cWeb\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3068\u3057\u3066\u5c0e\u5165\u300d\u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059\u3002<br \/>\n<!-- img --><br \/>\n<a target=\"_blank\" href=\"https:\/\/storage.googleapis.com\/sitest-wp\/blog\/wp-content\/uploads\/2017\/01\/WebApp_menu.png\"><img loading=\"lazy\" src=\"https:\/\/storage.googleapis.com\/sitest-wp\/blog\/wp-content\/uploads\/2017\/01\/WebApp_menu.png\" alt=\"WebApp_menu\" width=\"851\" height=\"377\" class=\"alignnone size-full wp-image-8002\" \/><\/a><br \/>\n\u5148\u307b\u3069\u6c7a\u3081\u305f\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u9078\u629e\u80a2\u3001\u3053\u3053\u3067\u3082\u516c\u958b\u7bc4\u56f2\u306e\u8a2d\u5b9a\u3092\u884c\u3044\u307e\u3059\u3002<br \/>\n\u4e0a\u90e8\u306b\u8868\u793a\u3055\u308c\u308bURL\u304c\u516c\u958b\u6642\u306eURL\u30a8\u30f3\u30c9\u30dd\u30a4\u30f3\u30c8\u3068\u306a\u308a\u307e\u3059\u3002<br \/>\n\u307e\u305f\u300c\u6700\u65b0\u306e\u30b3\u30fc\u30c9\u300d\u3068\u3042\u308b\u30ea\u30f3\u30af\u306b\u306f\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u6253\u305f\u306a\u304f\u3066\u3082\u3001\u6700\u65b0\u72b6\u614b\u306e\u30b3\u30fc\u30c9\u304c\u53cd\u6620\u3055\u308c\u308bURL\u3068\u306a\u308a\u307e\u3059\u3002<br \/>\n\u958b\u767a\u6642\u306b\u306f\u3053\u3061\u3089\u3092\u5229\u7528\u3059\u308b\u3068\u4fbf\u5229\u3067\u3059\u3002<br \/>\n<!-- img --><br \/>\n<a target=\"_blank\" href=\"https:\/\/storage.googleapis.com\/sitest-wp\/blog\/wp-content\/uploads\/2017\/01\/WebApp.png\"><img loading=\"lazy\" src=\"https:\/\/storage.googleapis.com\/sitest-wp\/blog\/wp-content\/uploads\/2017\/01\/WebApp.png\" alt=\"WebApp\" width=\"517\" height=\"643\" class=\"alignnone size-full wp-image-8003\" \/><\/a><\/p>\n<p>\u66f4\u65b0\u3092\u884c\u3044\u3001\u5148\u307b\u3069\u306eURL\u306b\u30a2\u30af\u30bb\u30b9\u3057JSON\u304c\u8fd4\u3063\u3066\u304f\u308c\u3070\u6210\u529f\u3067\u3059\uff01<\/p>\n<div class=\"frame_headding\">\n<h3 style=\"text-align: left;\">\u307e\u3068\u3081<\/h3>\n<\/div>\n<p>\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u3084Gmail\u306e\u64cd\u4f5c\u3067\u3088\u304f\u5229\u7528\u3055\u308c\u3066\u3044\u308bGoogle Apps Script\u3067\u3059\u304c\u3001\u3053\u306e\u3088\u3046\u306a\u4f7f\u3044\u65b9\u3082\u3042\u308a\u307e\u3059\u3002<br \/>\n\u4eca\u56de\u306fGET\u30e1\u30bd\u30c3\u30c9\u90e8\u5206\u3060\u3051\u306e\u51e6\u7406\u3092\u4f5c\u6210\u3057\u307e\u3057\u305f\u304c\u3001\u4f7f\u3044\u65b9\u6b21\u7b2c\u3067\u306fREST\u306aAPI\u30b5\u30fc\u30d0\u30fc\u3082\u4f5c\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<br \/>\nWebhook\u9023\u643a\u5148\u306a\u3069\u7c21\u5358\u306aAPI\u30b5\u30fc\u30d0\u30fc\u304c\u6b32\u3057\u3044\u3068\u304d\u306b\u306f\u3068\u3066\u3082\u91cd\u5b9d\u3057\u307e\u3059\u3002<\/p>\n<p>\u4eca\u5f8c\u3082Google Apps Script\u306e\u6d3b\u7528\u65b9\u6cd5\u3092\u3054\u7d39\u4ecb\u3057\u3066\u3044\u304d\u307e\u3059\u306e\u3067\u304a\u697d\u3057\u307f\u306b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3053\u3093\u3061\u306b\u306f\u3001\u30d7\u30ed\u30c0\u30af\u30c8\u958b\u767a\u30c1\u30fc\u30e0\u306e\u7267\u3067\u3059\u3002 \u6700\u8fd1\u3001\u30b5\u30fc\u30d0\u30fc\u30ec\u30b9\u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3\u304c\u71b1\u304f\u306a\u3063\u3066\u304d\u3066\u3044\u308b\u3068\u611f\u3058\u307e\u3059\u3002 \u308f\u3056\u308f\u3056API\u30b5\u30fc\u30d0\u30fc\u3092\u7acb\u3066\u308b\u5fc5\u8981\u306a\u304f\u3001\u30b3\u30fc\u30c9\u3092\u30c7\u30d7\u30ed\u30a4\u3059\u308b\u3060\u3051\u3067API\u30b5\u30fc\u30d0\u30fc\u3068\u3057\u3066\u5229\u7528\u3067\u304d\u307e\u3059\u3002 \u6709\u540d\u306a\u3082\u306e\u3067\u3059\u3068\u3001AWS Lambda\u3084Azure Functions\u3001Google\u306eCloud Functions\u306a\u3069\u3067\u30b5\u30fc\u30d3\u30b9\u63d0\u4f9b\u3055\u308c\u3066\u3044\u307e\u3059\u3002 \u4eca\u56de\u306f\u3001\u3082\u3063\u3068\u624b\u8efd\u306bGoogle Ap [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":8005,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[27],"tags":[],"acf":false,"_links":{"self":[{"href":"https:\/\/sitest.jp\/blog\/wp-json\/wp\/v2\/posts\/7835"}],"collection":[{"href":"https:\/\/sitest.jp\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sitest.jp\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sitest.jp\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sitest.jp\/blog\/wp-json\/wp\/v2\/comments?post=7835"}],"version-history":[{"count":6,"href":"https:\/\/sitest.jp\/blog\/wp-json\/wp\/v2\/posts\/7835\/revisions"}],"predecessor-version":[{"id":8105,"href":"https:\/\/sitest.jp\/blog\/wp-json\/wp\/v2\/posts\/7835\/revisions\/8105"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/sitest.jp\/blog\/wp-json\/wp\/v2\/media\/8005"}],"wp:attachment":[{"href":"https:\/\/sitest.jp\/blog\/wp-json\/wp\/v2\/media?parent=7835"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sitest.jp\/blog\/wp-json\/wp\/v2\/categories?post=7835"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sitest.jp\/blog\/wp-json\/wp\/v2\/tags?post=7835"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}