{"id":4319,"date":"2014-03-25T16:35:59","date_gmt":"2014-03-25T07:35:59","guid":{"rendered":"http:\/\/www.ka-net.org\/blog\/?p=4319"},"modified":"2014-03-25T16:35:59","modified_gmt":"2014-03-25T07:35:59","slug":"google-apps-script%e9%83%b5%e4%be%bf%e7%95%aa%e5%8f%b7%e3%81%8b%e3%82%89%e4%bd%8f%e6%89%80%e3%82%92%e5%8f%96%e5%be%97%e3%81%99%e3%82%8b%e8%87%aa%e4%bd%9c%e9%96%a2%e6%95%b0%e3%81%a8%e4%bd%8f%e6%89%80","status":"publish","type":"post","link":"https:\/\/www.ka-net.org\/blog\/?p=4319","title":{"rendered":"[Google Apps Script]\u90f5\u4fbf\u756a\u53f7\u304b\u3089\u4f4f\u6240\u3092\u53d6\u5f97\u3059\u308b\u81ea\u4f5c\u95a2\u6570\u3068\u4f4f\u6240\u304b\u3089\u5730\u56f3\u753b\u50cf\u306eURL\u3092\u53d6\u5f97\u3059\u308b\u81ea\u4f5c\u95a2\u6570"},"content":{"rendered":"<p><a href=\"http:\/\/zip.cgis.biz\/\" title=\"\u90f5\u4fbf\u756a\u53f7\u691c\u7d22API\" target=\"_blank\">\u90f5\u4fbf\u756a\u53f7\u691c\u7d22API<\/a>\u3092\u4f7f\u3063\u3066\u90f5\u4fbf\u756a\u53f7\u304b\u3089\u4f4f\u6240\u3092\u53d6\u5f97\u3059\u308b\u81ea\u4f5c\u95a2\u6570\u3068\u3001StaticMap\u30af\u30e9\u30b9\u3092\u4f7f\u3063\u3066\u4f4f\u6240\u304b\u3089\u5730\u56f3\u753b\u50cf\u306eURL\u3092\u53d6\u5f97\u3059\u308b\u81ea\u4f5c\u95a2\u6570\u3092\u8003\u3048\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">function getAddress(zip){\r\n    var ret = '';\r\n    var res = UrlFetchApp.fetch('http:\/\/zip.cgis.biz\/xml\/zip.php?zn=' + zip);\r\n    var doc = XmlService.parse(res.getContentText());\r\n    var address_value = doc.getRootElement().getChildren('ADDRESS_value');\r\n    if(address_value.length &gt; 0){\r\n        var attr;\r\n        var ary = new Array();\r\n        var items = address_value&#x5B;0].getChildren('value');\r\n        for (var i = 0; i &lt; items.length; i++){\r\n            attr = items&#x5B;i].getAttributes()&#x5B;0];\r\n            ary&#x5B;attr.getName()] = attr.getValue();\r\n        }\r\n        ret = ary&#x5B;'state'] + ary&#x5B;'city'] + ary&#x5B;'address'];\r\n    }else{\r\n        ret = '\u4f4f\u6240\u304c\u898b\u3064\u304b\u308a\u307e\u305b\u3093\u3067\u3057\u305f\u3002';\r\n    }\r\n    return ret;\r\n}<\/pre>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">function getMapUrl(address){\r\n    var url = Maps.newStaticMap()\r\n              .addAddress(address)\r\n              .addMarker(address)\r\n              .setLanguage('ja')\r\n              .setSize(400, 300)\r\n              .setMapType(Maps.StaticMap.Type.ROADMAP)\r\n              .setZoom(20)\r\n              .getMapUrl();\r\n    return url;\r\n}<\/pre>\n<p><a href=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/GoogleAppsScript_11_01.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/GoogleAppsScript_11_01.jpg\" alt=\"GoogleAppsScript_11_01\" width=\"940\" height=\"380\" class=\"alignnone size-full wp-image-4320\" srcset=\"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/GoogleAppsScript_11_01.jpg 940w, https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/GoogleAppsScript_11_01-300x121.jpg 300w\" sizes=\"auto, (max-width: 940px) 100vw, 940px\" \/><\/a><\/p>\n<p><a href=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/GoogleAppsScript_11_02.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/GoogleAppsScript_11_02.jpg\" alt=\"GoogleAppsScript_11_02\" width=\"940\" height=\"380\" class=\"alignnone size-full wp-image-4321\" srcset=\"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/GoogleAppsScript_11_02.jpg 940w, https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/GoogleAppsScript_11_02-300x121.jpg 300w\" sizes=\"auto, (max-width: 940px) 100vw, 940px\" \/><\/a><\/p>\n<ul>\n<li>Class StaticMap<\/li>\n<li style=\"list-style-type:none;\"><a href=\"https:\/\/developers.google.com\/apps-script\/reference\/maps\/static-map?hl=ja\" target=\"_blank\" title=\"Class StaticMap\">https:\/\/developers.google.com\/apps-script\/reference\/maps\/static-map?hl=ja<\/a><\/li>\n<li>Class XmlService<\/li>\n<li style=\"list-style-type:none;\"><a href=\"https:\/\/developers.google.com\/apps-script\/reference\/xml-service\/xml-service?hl=ja\" target=\"_blank\" title=\"Class XmlService\">https:\/\/developers.google.com\/apps-script\/reference\/xml-service\/xml-service?hl=ja<\/a><\/li>\n<li>Class Element<\/li>\n<li style=\"list-style-type:none;\"><a href=\"https:\/\/developers.google.com\/apps-script\/reference\/xml-service\/element?hl=ja\" target=\"_blank\" title=\"Class Element\">https:\/\/developers.google.com\/apps-script\/reference\/xml-service\/element?hl=ja<\/a><\/li>\n<li>Class Attribute<\/li>\n<li style=\"list-style-type:none;\"><a href=\"https:\/\/developers.google.com\/apps-script\/reference\/xml-service\/attribute?hl=ja\" target=\"_blank\" title=\"Class Attribute\">https:\/\/developers.google.com\/apps-script\/reference\/xml-service\/attribute?hl=ja<\/a><\/li>\n<li>IMAGE &#8211; \u30c9\u30e9\u30a4\u30d6 \u30d8\u30eb\u30d7<\/li>\n<li style=\"list-style-type:none;\"><a href=\"https:\/\/support.google.com\/drive\/answer\/3093333?hl=ja\" target=\"_blank\" title=\"IMAGE - \u30c9\u30e9\u30a4\u30d6 \u30d8\u30eb\u30d7\">https:\/\/support.google.com\/drive\/answer\/3093333?hl=ja<\/a><\/li>\n<\/ul>\n<h4>\u3010\u7de8\u96c6\u5f8c\u8a18\u3011<\/h4>\n<p>\u308f\u3056\u308f\u3056\u95a2\u6570\u5316\u3059\u308b\u307b\u3069\u306e\u3082\u306e\u3067\u3082\u306a\u3044\u306e\u3067\u3059\u304c\u3001GAS\u306e\u7df4\u7fd2\u3068\u3044\u3046\u3053\u3068\u3067\u30b3\u30fc\u30c9\u3092\u66f8\u3044\u3066\u307f\u307e\u3057\u305f\u3002<br \/>\n\u304c\u3001\u52d5\u4f5c\u306f\u3042\u307e\u308a\u306b\u9045\u304f\u3001\u5b9f\u7528\u7684\u306a\u3082\u306e\u3068\u306f\u8a00\u3048\u305d\u3046\u306b\u306a\u3044\u3067\u3059\u30fb\u30fb\u30fb\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u90f5\u4fbf\u756a\u53f7\u691c\u7d22API\u3092\u4f7f\u3063\u3066\u90f5\u4fbf\u756a\u53f7\u304b\u3089\u4f4f\u6240\u3092\u53d6\u5f97\u3059\u308b\u81ea\u4f5c\u95a2\u6570\u3068\u3001StaticMap\u30af\u30e9\u30b9\u3092\u4f7f\u3063\u3066\u4f4f\u6240\u304b\u3089\u5730\u56f3\u753b\u50cf\u306eURL\u3092\u53d6\u5f97\u3059\u308b\u81ea\u4f5c\u95a2\u6570\u3092\u8003\u3048\u3066\u307f\u307e\u3057\u305f\u3002 function getAddress(zip){ var r [&hellip;]","protected":false},"author":1,"featured_media":7113,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[126],"tags":[],"class_list":["post-4319","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-google"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/eyecatch-Google.png","jetpack_shortlink":"https:\/\/wp.me\/p4UZZr-17F","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/4319","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4319"}],"version-history":[{"count":1,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/4319\/revisions"}],"predecessor-version":[{"id":4322,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/4319\/revisions\/4322"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/media\/7113"}],"wp:attachment":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4319"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4319"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4319"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}