{"id":10331,"date":"2019-11-07T13:25:33","date_gmt":"2019-11-07T04:25:33","guid":{"rendered":"http:\/\/www.moonmile.net\/blog\/?p=10331"},"modified":"2019-11-07T16:42:12","modified_gmt":"2019-11-07T07:42:12","slug":"scratch-3-0-%e3%81%a7-web-api-%e5%91%bc%e3%81%b3%e5%87%ba%e3%81%97%e3%81%ae%e6%8b%a1%e5%bc%b5%e3%83%96%e3%83%ad%e3%83%83%e3%82%af%e3%82%92%e4%bd%9c%e3%82%8b%e3%80%81%e3%81%ae%e6%89%8b%e5%a7%8b","status":"publish","type":"post","link":"http:\/\/www.moonmile.net\/blog\/archives\/10331","title":{"rendered":"Scratch 3.0 \u3067 Web API \u547c\u3073\u51fa\u3057\u306e\u62e1\u5f35\u30d6\u30ed\u30c3\u30af\u3092\u4f5c\u308b\u3001\u306e\u624b\u59cb\u3081"},"content":{"rendered":"<p>Scratch 3.0 \u306e\u62e1\u5f35\u30d6\u30ed\u30c3\u30af\u306e\u4f5c\u308a\u65b9\u304c\u5206\u304b\u3063\u3066\u304d\u305f\u306e\u3067\u3001Web API \u306e\u547c\u3073\u51fa\u3057\u3092\u4f5c\u3063\u3066\u307f\u308b\u3002<\/p>\n<p>\u57fa\u672c\u7684\u306a\u3068\u3053\u308d\u306f\u3001<a href=\"https:\/\/qiita.com\/Hiroyuki_OSAKI\/items\/a46e1c881d3aed4661f7\">Scratch 3.0\u3067\u30aa\u30ea\u30b8\u30ca\u30eb\u30d6\u30ed\u30c3\u30af\u3092\u3064\u304f\u308d\u3046 &#8211; Qiita<\/a> \u3068\u540c\u3058\u3067\u3001\u3082\u3046\u3061\u3087\u3063\u3068\u5148\u306b\u9032\u3093\u3067\u307f\u3088\u3046\u3001\u3068\u3044\u3046\u3068\u3053\u308d\u3067\u3059\u3002Scratch \u81ea\u4f53\u304c\u5b66\u7fd2\u7528\u306a\u306e\u3067\u3001\u305d\u306e\u76ee\u7684\u306b\u6cbf\u3063\u3066\u3044\u308b\u304b\u3069\u3046\u304b\u306f\u5206\u304b\u3089\u306a\u3044\u306e\u3067\u3059\u304c\u3001\u307e\u3041\u3001\u3061\u3087\u3063\u3068\u3070\u304b\u3057\u7121\u8336\u3092\u3084\u3063\u3066\u696d\u52d9\u3067\u4f7f\u3063\u3066\u307f\u308b\u306e\u3082\u30a2\u30ea\u304b\u306a\u3041\u3068\u3002\u300cScratch \u306f\u30d7\u30ed\u30b0\u30e9\u30e0\u8a00\u8a9e\u306a\u306e\u304b\uff1f\u300d\u3068\u3044\u3046\u8cea\u554f\u304c\u591a\u3044\u4e2d\u3067\u3001\u3058\u3083\u3042\u3001\u5b9f\u7528\u7684\u306a\u696d\u52d9\u3067\u4f7f\u3046\u305f\u3081\u306b\u306f\u3053\u3093\u306a\u30d1\u30bf\u30fc\u30f3\u304c\u3042\u308b\u3068\u3044\u3046\u4f8b\u3067\u3059\u3002<\/p>\n<h2 id=\"%E9%81%A9%E5%BD%93%E3%81%AA-mda-%E3%83%84%E3%83%BC%E3%83%AB%E3%81%A8%E3%81%97%E3%81%A6%E4%BD%BF%E3%81%86\">\u9069\u5f53\u306a MDA \u30c4\u30fc\u30eb\u3068\u3057\u3066\u4f7f\u3046<\/h2>\n<p>\u30d6\u30ed\u30c3\u30af\u3092\u7d44\u307f\u5408\u308f\u305b\u3066\u30ed\u30b8\u30c3\u30af\u3092\u4f5c\u308b\u8a00\u8a9e\uff08\u30d3\u30b8\u30e5\u30a2\u30eb\u8a00\u8a9e\u3068\u304b\u30d6\u30ed\u30c3\u30af\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u3068\u304b\uff09\u306f\u3001Scratch \u306e\u4ed6\u306b\u3069\u3093\u306a\u3082\u306e\u304c\u3042\u308b\u306e\u304b\uff1f\u3068\u3044\u3046\u3068\u3001<\/p>\n<ul>\n<li>micro:bit \u306e <a href=\"https:\/\/makecode.microbit.org\/\">MakeCode<\/a><\/li>\n<li>Microsoft Flow \u6539\u3081 Power Automate <a href=\"https:\/\/flow.microsoft.com\/en-us\/\">Power Automate <\/a><\/li>\n<li><a href=\"https:\/\/nodered.jp\/\">Node-RED\u65e5\u672c\u30e6\u30fc\u30b6\u4f1a<\/a><\/li>\n<\/ul>\n<p>\u306a\u3093\u3066\u306e\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u306e\u4e2d\u306b UML \u3092\u542b\u3081\u3066\u3082\u3044\u3044\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002\u30d6\u30ed\u30c3\u30af\u3092\u7d44\u307f\u5408\u308f\u305b\u3066\u7d30\u304b\u3044\u30ed\u30b8\u30c3\u30af\uff08\u52a0\u7b97\u3084\u6e1b\u7b97\u306a\u3069\uff09\u3092\u7d44\u3080\u3082\u306e\u3082\u3042\u308c\u3070\u3001\u3042\u308b\u7a0b\u5ea6\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u5316\u3055\u308c\u305f\u3082\u306e\u3092\u547c\u3073\u51fa\u3059 MDA\uff08\u30e2\u30c7\u30eb\u99c6\u52d5\u578b\u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3\uff09\u7684\u306a\u3082\u306e\u3082\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>Scratch \u306e\u5834\u5408\u306f\u3001\u7d30\u304b\u3044\u30ed\u30b8\u30c3\u30af\u3092\u7d44\u3080\u6240\u8b02\u30d7\u30ed\u30b0\u30e9\u30e0\u8a00\u8a9e\u306b\u5c5e\u3059\u308b\u8a33\u3067\u3059\u304c\u3001\u624b\u9806\u3092\u7e4b\u3052\u305f\u308a\u6761\u4ef6\u5206\u5c90\u3092\u3046\u307e\u304f\u4f7f\u3048\u3070 MDA \u306a\u30c4\u30fc\u30eb\u3068\u3057\u3066\u3082\u4f7f\u3048\u308b&#8230;\u3068\u601d\u3063\u3066\u307f\u308b\u308f\u3051\u3067\u3059\u3002<\/p>\n<p>\u8a66\u3057\u3066\u307f\u308b\u306e\u306f\u3001<\/p>\n<ul>\n<li>\u9069\u5f53\u306a Web API \u3092\u8907\u6570\u56de\u547c\u3073\u51fa\u3059<\/li>\n<li>Web API \u306e\u623b\u308a\u5024\u3067\u9069\u5f53\u306b\u5206\u5c90\u3059\u308b<\/li>\n<li>Web API \u306e\u623b\u308a\u5024\u3067\u9069\u5f53\u306b\u732b\u304c\u558b\u308b<\/li>\n<\/ul>\n<p>\u3042\u305f\u308a\u3092\u60f3\u5b9a\u3057\u3066\u4f5c\u3063\u3066\u3044\u304d\u307e\u3059\u3002<br \/>\n\u30c6\u30b9\u30c8\u30c7\u30fc\u30bf\u306e\u6295\u5165\u3092\u81ea\u52d5\u5316\u3059\u308b\u3068\u304b\u3001\u30b5\u30f3\u30d7\u30eb\u30c7\u30fc\u30bf\u306e\u6295\u5165\u3042\u305f\u308a\u3092\u8003\u3048\u3066\u307f\u307e\u3059\u3002<\/p>\n<h2 id=\"%E4%B8%8B%E6%BA%96%E5%82%99\">\u4e0b\u6e96\u5099<\/h2>\n<p>\u307e\u305a\u306f\u3001\u30ed\u30fc\u30ab\u30eb\u74b0\u5883\u3067 Scratch 3.0 \u304c\u52d5\u304f\u74b0\u5883\u3092\u6574\u3048\u307e\u3059\u3002Linux \u74b0\u5883\u3067\u3084\u308b\u306e\u304c\u671b\u307e\u3057\u3044\u306e\u3067\u3059\u304c\u3001Windows \u306e WSL \u3092\u4f7f\u3063\u3066\u3082\u5927\u4e08\u592b\u3067\u3059\u3002\u3068\u3044\u3046\u304b\u3001VSCode \u3092\u4f7f\u3046\u3068\u4fbf\u5229\u306a\u306e\u3067\u3001WSL \u304c\u304a\u85a6\u3081\u3067\u3059\u3002<\/p>\n<h3 id=\"github-%E3%81%8B%E3%82%89%E3%82%B3%E3%83%BC%E3%83%89%E3%82%92%E3%83%80%E3%82%A6%E3%83%B3%E3%83%AD%E3%83%BC%E3%83%89\">github \u304b\u3089\u30b3\u30fc\u30c9\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9<\/h3>\n<pre class=\"hljs\"><code>\n\n<div>$ git clone --depth 1 https:\/\/github.com\/llk\/scratch-vm.git \n$ git clone --depth 1 https:\/\/github.com\/llk\/scratch-gui.git\n<\/div>\n\n<\/code><\/pre>\n<h3 id=\"%E3%83%93%E3%83%AB%E3%83%89\">\u30d3\u30eb\u30c9<\/h3>\n<pre class=\"hljs\"><code>\n\n<div>$ cd scratch-vm \n$ npm i \n$ sudo npm link \n$ cd ..\/scratch-gui \n$ npm i \n$ sudo npm link scratch-vm\n<\/div>\n\n<\/code><\/pre>\n<p>scratch-vm \u306b\u62e1\u5f35\u6a5f\u80fd\u3092\u4f7f\u3063\u3066\u3001scratch-gui \u3067 UI \u3092\u52d5\u304b\u3057\u307e\u3059\u3002scratch-gui \u306f React \u304c\u4f7f\u308f\u308c\u3066\u3044\u308b\u306e\u3067\u3001scratch-vm \u5185\u306e\u30b3\u30fc\u30c9\u3092\u4fee\u6b63\u3059\u308b\u3068\u81ea\u52d5\u7684\u306b\u30d6\u30e9\u30a6\u30b6\u306e\u307b\u3046\u3067\u30ea\u30ed\u30fc\u30c9\u304c\u639b\u304b\u308a\u307e\u3059\u3002<\/p>\n<h3 id=\"%E8%A9%A6%E3%81%97%E3%81%AB%E5%AE%9F%E8%A1%8C\">\u8a66\u3057\u306b\u5b9f\u884c<\/h3>\n<p>\u30ed\u30fc\u30ab\u30eb\u74b0\u5883\u3067 http:\/\/localhost:8601\/ \u3068\u3059\u308c\u3070\u3001\u30d6\u30e9\u30a6\u30b6\u3067 Scratch 3.0 \u304c\u52d5\u304f\u72b6\u614b\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"hljs\"><code>\n\n<div>$ cd scratch-gui \n$ npm start \n<\/div>\n\n<\/code><\/pre>\n<p><a href=\"http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2019\/11\/images20191107_01org-1.jpg\"><img decoding=\"async\" src=\"http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2019\/11\/images20191107_01thum-1.jpg\"><\/a><br \/>\n<a href=\"http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2019\/11\/images20191107_02org-1.jpg\"><img decoding=\"async\" src=\"http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2019\/11\/images20191107_02thum-1.jpg\"><\/a><\/p>\n<p>\u3053\u306e\u72b6\u614b\u3067\u3001\u307b\u307c https:\/\/scratch.mit.edu\/ \u3068\u540c\u3058\u72b6\u614b\u306b\u306a\u308a\u307e\u3059\u3002\u9055\u3044\u306f\u3001<\/p>\n<ul>\n<li>\u5171\u6709\u304c\u3067\u304d\u306a\u3044<\/li>\n<li>\u30b5\u30fc\u30d0\u30fc\u306b\u30b3\u30fc\u30c9\u304c\u81ea\u52d5\u4fdd\u5b58\u3055\u308c\u306a\u3044\u3002<\/li>\n<\/ul>\n<p>\u3053\u3068\u3050\u3089\u3044\u3067\u3059\u3002<\/p>\n<p>\u30ed\u30fc\u30ab\u30eb\u74b0\u5883\u3067\u306f\u3001\u300c\u30d5\u30a1\u30a4\u30eb\u300d\u30e1\u30cb\u30e5\u30fc\u304b\u3089\u30ed\u30fc\u30ab\u30eb\u306e\u30b3\u30f3\u30d4\u30e5\u30fc\u30bf\u306b\u30b3\u30fc\u30c9\u3092\u4fdd\u5b58\u3067\u304d\u307e\u3059\u3002\u3053\u306e\u4fdd\u5b58\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u3092\u672c\u5bb6\u306e Scratch \u306b\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3059\u308c\u3070\u5171\u6709\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u305f\u3060\u3057\u3001\u4eca\u56de\u306e\u3088\u3046\u306a\u30aa\u30ea\u30b8\u30ca\u30eb\u306a\u62e1\u5f35\u30d6\u30ed\u30c3\u30af\u3092\u4f7f\u3063\u3066\u3044\u308b\u5834\u5408\u306f\u672c\u5bb6\u3067\u306f\u52d5\u304b\u306a\u3044\u306e\u3067\u3001\u9069\u5b9c\u30ed\u30fc\u30ab\u30eb\u74b0\u5883\u3067\u52d5\u304b\u3059\u304b\u3001\u793e\u5185\u3067\u9069\u5f53\u306a\u30b5\u30fc\u30d0\u30fc\u3092\u7acb\u3066\u3066\uff08\u30e9\u30ba\u30d1\u30a43\u3068\u304b\u3067\u3082\u5341\u5206\u3067\u3059\uff09\u305d\u3053\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u304b\u3001\u3068\u3044\u3046\u5f62\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u591a\u5206\u3001\u30e9\u30ba\u30d1\u30a4\u4e0a\u306b Scratch 3.0 \u306e\u30b5\u30fc\u30d0\u30fc\u3092\u7acb\u3066\u3066\u3001\u305d\u3053\u304b\u3089 Arduino \u306b\u63a5\u7d9a\u3055\u305b\u308b\u3068\u304b\u3001\u30bb\u30f3\u30b5\u30fc\u306e\u30c7\u30fc\u30bf\u3092\u8aad\u307f\u53d6\u308b\u3068\u304b\u3059\u308b\u307b\u3046\u304c PC \u3088\u308a\u3082\u624b\u8efd\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002\u305d\u306e\u3042\u305f\u308a\u306f\u304a\u3044\u304a\u3044\u6a21\u7d22\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<h3 id=\"%E3%83%AA%E3%83%A2%E3%83%BC%E3%83%88%E7%92%B0%E5%A2%83%E3%81%A7-vscode-%E3%82%92%E5%8B%95%E3%81%8B%E3%81%99\">\u30ea\u30e2\u30fc\u30c8\u74b0\u5883\u3067 VSCode \u3092\u52d5\u304b\u3059<\/h3>\n<p>WSL\uff08Windows System Linux\uff09\u306b\u306f\u30ea\u30e2\u30fc\u30c8\u63a5\u7d9a\u5bfe\u5fdc\u306e VScode \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"hljs\"><code>\n\n<div>$ code .\n<\/div>\n\n<\/code><\/pre>\n<p>WSL \u4e0a\u3067\u3053\u3093\u306a\u98a8\u306b code \u30b3\u30de\u30f3\u30c9\u3092\u5165\u308c\u308b\u3068\u3001\u81ea\u52d5\u7684\u306b Windows \u5074\u3067 VSCode \u304c\u7acb\u3061\u4e0a\u304c\u3063\u3066\u304f\u308c\u307e\u3059\u3002<\/p>\n<p><a href=\"http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2019\/11\/images20191107_03org-1.jpg\"><img decoding=\"async\" src=\"http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2019\/11\/images20191107_03thum-1.jpg\"><\/a><\/p>\n<p>\u30c9\u30e9\u30a4\u30d6\u304c\u5171\u6709\u306b\u306a\u3063\u3066\u3044\u308b\u306e\u3067\u3001Windows \u5074\u3067\u95b2\u89a7\u3057\u3066\u3082\u3088\u3044\u306e\u3067\u3059\u304c\u3001WSL \u5074\u3068\u30d5\u30a1\u30a4\u30eb\u7af6\u5408\u304c\u767a\u751f\u3057\u3066\u307e\u3046\u306e\u3067\u3001\u30ea\u30e2\u30fc\u30c8\u63a5\u7d9a\u306b\u3057\u307e\u3059\u3002\u3053\u3053\u3067 *.js \u306e\u30d5\u30a1\u30a4\u30eb\u3092\u7de8\u96c6\u3057\u3066\u4fdd\u5b58\u3059\u308b\u3068\u81ea\u52d5\u7684\u306b\u30d6\u30e9\u30a6\u30b6\u306e\u307b\u3046\u3067\u30ea\u30ed\u30fc\u30c9\u304c\u639b\u304b\u308a\u307e\u3059\u3002<\/p>\n<h2 id=\"scratch-vm-%E3%81%AE%E7%B7%A8%E9%9B%86\">scratch-vm \u306e\u7de8\u96c6<\/h2>\n<p>\u62e1\u5f35\u6a5f\u80fd\u3092\u300cwebapisample\u300d\u306b\u3057\u3066\u4f5c\u6210\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"hljs\"><code>\n\n<div>$ mkdir scratch-vm\/src\/extensions\/scratch3_webapisample\/\n$ touch scratch-vm\/src\/extensions\/scratch3_webapisample\/index.js\n<\/div>\n\n<\/code><\/pre>\n<p>scratch-vm\/src\/extensions \u30d5\u30a9\u30eb\u30c0\u30fc\u306e\u4e2d\u306b\u3001\u65b0\u3057\u304f\u300cwebapisample\u300d\u30d5\u30a9\u30eb\u30c0\u30fc\u3092\u4f5c\u3063\u3066 index.js \u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"hljs\"><code>\n\n<div>const ArgumentType = require('..\/..\/extension-support\/argument-type');\nconst BlockType = require('..\/..\/extension-support\/block-type');\nconst Cast = require('..\/..\/util\/cast');\nconst log = require('..\/..\/util\/log');\n\nclass Scratch3WebApiSample {\n    constructor (runtime) {\n        this.runtime = runtime;\n        this._result = \"\" ;\n        this._url = \"\";\n        this._result = \"\";\n    }\n\n    getInfo () {\n        return {\n            id: 'webapisample',\n            name: 'Web API Sample',\n            blocks: [\n                {\n                    opcode: 'setUrl',\n                    blockType: BlockType.COMMAND,\n                    text: 'Set URL [TEXT]',\n                    arguments: {\n                        TEXT: {\n                            type: ArgumentType.STRING,\n                            defaultValue: \"http:\/\/localhost:5000\/api\/Hello\/\"\n                        }\n                    }\n                },\n                {\n                    opcode: 'getUrl',\n                    blockType: BlockType.REPORTER,\n                    text: 'URL'\n                },\n                {\n                    opcode: 'getResult',\n                    blockType: BlockType.REPORTER,\n                    text: 'result'\n                },\n                {\n                    opcode: 'callWebApiByGet',\n                    blockType: BlockType.REPORTER,\n                    text: 'Call Web API GET [TEXT]',\n                    arguments: {\n                        TEXT: {\n                            type: ArgumentType.STRING,\n                            defaultValue: \"100\"\n                        }\n                    }\n                }\n            ],\n            menus: {\n            }\n        };\n    }\n\n    setUrl( args ) {\n        const text = Cast.toString(args.TEXT);\n        this._url = text ;\n    }\n    getUrl() {\n        return this._url ;\n    }\n    getResult() {\n        return this._result ;\n    }\n    callWebApiByGet(args) {\n        const text = Cast.toString(args.TEXT);\n        const path = this._url + text ;\n        var pr = fetch( path ) \n            .then( res =&gt; res.text() )\n            .then( body =&gt; this._result = body ) ;\n        return pr ;\n    }\n}\n\nmodule.exports = Scratch3WebApiSample;\n<\/div>\n\n<\/code><\/pre>\n<p>\u5c11\u3057\u7656\u304c\u3042\u308b\u306e\u3067\u3059\u304c\u3001<\/p>\n<ul>\n<li>getInfo \u95a2\u6570\u3067\u3001\u30d6\u30ed\u30c3\u30af\u306e\u60c5\u5831\u3092\u8fd4\u3059<\/li>\n<li>opcode \u306b\u5bfe\u5fdc\u3059\u308b\u95a2\u6570\u540d\u3092\u8a18\u8ff0\u3059\u308b<\/li>\n<li>\u305d\u308c\u305e\u308c\u306e\u95a2\u6570\u5185\u3067 Javascript \u3067\u8a18\u8ff0\u3059\u308b<\/li>\n<\/ul>\n<p>\u30d6\u30ed\u30c3\u30af\u306e\u7a2e\u985e\u306b\u306f\u3044\u304f\u3064\u304b\u3042\u308b\u306e\u3067\u3059\u304c\u3001<\/p>\n<ul>\n<li>BlockType.COMMAND : \u30b3\u30de\u30f3\u30c9\u30d6\u30ed\u30c3\u30af\uff08\u975e\u540c\u671f\uff09<\/li>\n<li>BlockType.REPORTER : \u5024\u30d6\u30ed\u30c3\u30af\uff08\u540c\u671f\u51e6\u7406\uff09<\/li>\n<\/ul>\n<p>\u306b\u306a\u308a\u307e\u3059\u3002Web API\u547c\u3073\u51fa\u3057\u3067\u306f\u3001fetch \u3092\u4f7f\u3046\u306e\u3067\u3059\u304c\u3001\u3053\u3053\u3092\u30b3\u30de\u30f3\u30c9\u30d6\u30ed\u30c3\u30af\u306b\u3059\u308b\u3068\u623b\u308a\u5024\u304c\u53d6\u308c\u307e\u305b\u3093\u3002\u306a\u306e\u3067\u3001\u5024\u30d6\u30ed\u30c3\u30af\u306b\u3057\u3066\u540c\u671f\u7684\u306b\u51e6\u7406\u3092\u884c\u3044\u307e\u3059\u3002\u623b\u308a\u5024\u306f fetch \u304c\u8fd4\u3059 Promise \u578b\u3092\u4f7f\u3048\u3070 ok \u3067\u3059\u3002<\/p>\n<p><a href=\"https:\/\/ja.scratch-wiki.info\/wiki\/Scratch_3.0%E3%81%AE%E6%8B%A1%E5%BC%B5%E6%A9%9F%E8%83%BD%E3%82%92%E4%BD%9C%E3%81%A3%E3%81%A6%E3%81%BF%E3%82%88%E3%81%86\/%E5%BF%9C%E7%94%A8\">Scratch 3.0\u306e\u62e1\u5f35\u6a5f\u80fd\u3092\u4f5c\u3063\u3066\u307f\u3088\u3046\/\u5fdc\u7528 &#8211; Japanese Scratch-Wiki<\/a> \u3092\u53c2\u8003\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"hljs\"><code>\n   callWebApiByGet(args) {\n        const text = Cast.toString(args.TEXT);\n        const path = this._url + text ;\n        var pr = fetch( path ) \n            .then( res =&gt; res.text() )\n            .then( body =&gt; this._result = body ) ;\n        return pr ;\n    }\n<\/code><\/pre>\n<p>\u3053\u3053\u3067\u306f4\u3064\u306e\u30d6\u30ed\u30c3\u30af\u3092\u4f5c\u3063\u3066\u3044\u3066\u3001\u3053\u3093\u306a\u611f\u3058\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><a href=\"http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2019\/11\/images20191107_05org-1.jpg\"><img decoding=\"async\" src=\"http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2019\/11\/images20191107_05thum-1.jpg\"><\/a><\/p>\n<p>Web API \u3092\u5b9f\u884c\u3059\u308b http:\/\/localhost:5000\/api\/Hello\/ \u306f\u5f8c\u3067\u3001ASP.NET Core MVC \u3067\u4f5c\u308a\u307e\u3059\u3002\u3053\u3053\u306e\u547c\u3073\u5148\u306f\u3001PHP \u3067\u4f5c\u3063\u3066\u3082\u3044\u3044\u3057\u3001nodejs \u3067\u3082\u3044\u3044\u3057\u3001Azure Functions \u3067\u3082\u69cb\u3044\u307e\u305b\u3093\u3002<\/p>\n<p>\u30af\u30e9\u30b9\u5185\u306e\u5909\u6570\u306e\u6271\u3044\u306f\u3001JS \u306a\u306e\u3067\u305d\u308c\u306b\u5247\u308a\u307e\u3059\u3002\u3053\u306e\u3042\u305f\u308a\u3001\u30b3\u30fc\u30c9\u81ea\u4f53\u306f Javascript \u306a\u306e\u3067\u3001\u7d50\u69cb\u3044\u308d\u3044\u308d\u306a\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>scratch-vm\/src\/extension-support\/extension-manager.js \u306e\u30d5\u30a1\u30a4\u30eb\u306b\u3001\u62e1\u5f35\u6a5f\u80fd\u3092\u30a4\u30f3\u30af\u30eb\u30fc\u30c9\u3059\u308b\u305f\u3081\u306e\u884c\u3092\u8ffd\u52a0\u3057\u3066\u304a\u304d\u307e\u3059\u3002\u4ee5\u4e0b\u306e\u300c\u2605\u300d\u306e\u90e8\u5206\u3067\u3059\u3002<\/p>\n<pre class=\"hljs\"><code>\n\n<div>const builtinExtensions = {\n    \/\/ This is an example that isn't loaded with the other core blocks,\n    \/\/ but serves as a reference for loading core blocks as extensions.\n    coreExample: () =&gt; require('..\/blocks\/scratch3_core_example'),\n    \/\/ These are the non-core built-in extensions.\n    pen: () =&gt; require('..\/extensions\/scratch3_pen'),\n    wedo2: () =&gt; require('..\/extensions\/scratch3_wedo2'),\n    music: () =&gt; require('..\/extensions\/scratch3_music'),\n    microbit: () =&gt; require('..\/extensions\/scratch3_microbit'),\n    text2speech: () =&gt; require('..\/extensions\/scratch3_text2speech'),\n    translate: () =&gt; require('..\/extensions\/scratch3_translate'),\n    videoSensing: () =&gt; require('..\/extensions\/scratch3_video_sensing'),\n    ev3: () =&gt; require('..\/extensions\/scratch3_ev3'),\n    makeymakey: () =&gt; require('..\/extensions\/scratch3_makeymakey'),\n    boost: () =&gt; require('..\/extensions\/scratch3_boost'),\n    gdxfor: () =&gt; require('..\/extensions\/scratch3_gdx_for'),\n    webapisample: () =&gt; require('..\/extensions\/scratch3_webapisample') \/\/ \u2605\n};\n<\/div>\n\n<\/code><\/pre>\n<p>\u6700\u7d42\u7684\u306b\u306f id \u3092\u4f7f\u3063\u305f\u308a\u3059\u308b\u306e\u3067\u3057\u3087\u3046\u304c\u3001\u3044\u307e\u306f\u3053\u306e\u307e\u307e\u3067\u3002<\/p>\n<p>vscode \u3067\u30d5\u30a1\u30a4\u30eb\u4fdd\u5b58\u3057\u3066\u7279\u306b\u30a8\u30e9\u30fc\u304c\u51fa\u306a\u3051\u308c\u3070 ok \u3067\u3059\u3002<\/p>\n<h2 id=\"scratch-gui-%E3%81%AE%E7%B7%A8%E9%9B%86\">scratch-gui \u306e\u7de8\u96c6<\/h2>\n<p>scratch-gui \u3067\u306f\u62e1\u5f35\u6a5f\u80fd\u3092\u8aad\u307f\u53d6\u308b\u3068\u3053\u308d\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"hljs\"><code>\n\n<div>$ mkdir scratch-gui\/src\/lib\/libraries\/extensions\/webapisample\n<\/div>\n\n<\/code><\/pre>\n<p>webapisample \u3053\u306e\u30d5\u30a9\u30eb\u30c0\u30fc\u306b2\u3064\u306e\u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u3092\u7f6e\u304d\u307e\u3059\u3002<\/p>\n<ul>\n<li>webapi.png<\/li>\n<li>webapi-small.png<\/li>\n<\/ul>\n<p><a href=\"http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2019\/11\/images20191107_07org-1.jpg\"><img decoding=\"async\" src=\"http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2019\/11\/images20191107_07thum-1.jpg\"><\/a><\/p>\n<p>\u62e1\u5f35\u6a5f\u80fd\u3092\u8aad\u307f\u8fbc\u3080\u3068\u304d\u306b\u4f7f\u308f\u308c\u308b\u753b\u50cf\u3067\u3059\u306d\u3002\u9762\u5012\u306a\u306a\u306e\u3067\u5b57\u3060\u3051\u3067\u3059\uff08\u82e6\u7b11\uff09\u3002<\/p>\n<p>scratch-gui\/src\/lib\/libraries\/extensions\/index.jsx \u8ffd\u52a0\u306e\u8a2d\u5b9a\u3092\u8a18\u8ff0\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"hljs\"><code>\n\n<div>import webapisampleIconURL from '.\/webapisample\/webapi.png';\nimport webapisampleInsetIconURL from '.\/webapisample\/webapi-small.png';\n\n\/\/ \u7701\u7565\n\n    {\n        name: \"Web API Sample Blocks\",\n        extensionId: 'webapisample',\n        iconURL: webapisampleIconURL,\n        insetIconURL: webapisampleInsetIconURL,\n        collaborator: 'moonmile',\n        description: \"You can call Web API.\",\n        featured: true,\n        internetConnectionRequired: true,\n        helpLink: 'http:\/\/moonmile.net\/'\n    }\n}\n<\/div>\n\n<\/code><\/pre>\n<p>\u6700\u521d\u306e import \u306f\u30a2\u30a4\u30b3\u30f3\u3092\u6307\u5b9a\u3057\u3066\u3044\u308b\u3060\u3051\u306a\u306e\u3067\u3001\u76f4\u306b iconURL \u3084 insetIconURL \u306b\u6307\u5b9a\u3057\u3066\u3082\u3088\u3044\u3067\u3057\u3087\u3046\u3002\u591a\u8a00\u8a9e\u5316\u3057\u306a\u3044\u306e\u3067\u3001FormattedMessage \u3092\u4f7f\u308f\u305a\u306b\u76f4\u66f8\u304d\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u30d5\u30a1\u30a4\u30eb\u3092\u4fdd\u5b58\u3057\u3066\u3001Scratch 3.0 \u5074\u3067\u62e1\u5f35\u6a5f\u80fd\u3092\u8aad\u307f\u8fbc\u3080\u3068\u3001\u30aa\u30ea\u30b8\u30ca\u30eb\u306e\u30d6\u30ed\u30c3\u30af\u304c\u73fe\u308c\u307e\u3059\u3002Javascript \u306e\u30b3\u30fc\u30c9\u304c\u9593\u9055\u3063\u3066\u3044\u305f\u308a\u3001\u30d6\u30ed\u30c3\u30af\u306e opcode \u306a\u3069\u306e\u8a2d\u5b9a\u304c\u9593\u9055\u3063\u3066\u3044\u308b\u3068\u3001\u62e1\u5f35\u30d6\u30ed\u30c3\u30af\u306e\u90e8\u5206\u304c\u8aad\u307f\u8fbc\u3081\u306a\u3044\u306e\u3067\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u8aad\u307f\u8fbc\u3081\u306a\u304b\u3063\u305f\u3068\u304d\u306e\u30c7\u30d0\u30c3\u30b0\u624b\u6bb5\u304c\u306a\u3044\u306e\u3067\u3001\u3061\u3087\u3063\u3068\u305a\u3064\u30d6\u30ed\u30c3\u30af\u3092\u5897\u3084\u3057\u3066\u3044\u304f\u306e\u304c\u30b3\u30c4\u3067\u3059\u3002<\/p>\n<p><a href=\"http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2019\/11\/images20191107_08org-1.jpg\"><img decoding=\"async\" src=\"http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2019\/11\/images20191107_08thum-1.jpg\"><\/a><\/p>\n<h2 id=\"web-api-%E3%82%92%E4%BD%9C%E3%82%8B\">Web API \u3092\u4f5c\u308b<\/h2>\n<p>.NET Core \u3092\u4f7f\u3063\u3066\u30c6\u30b9\u30c8\u7528\u306e Web API \u30b5\u30fc\u30d0\u30fc\u3092\u4f5c\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"hljs\"><code>\n\n<div>$ dotnet new webapi -n hello\n<\/div>\n\n<\/code><\/pre>\n<p>\u3053\u3093\u306a\u98a8\u306b hello \u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u3063\u305f\u5f8c\u306b\u3001Controllers\/HelloController.cs \u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"hljs\"><code>\n\n<div>using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Threading.Tasks;\nusing Microsoft.AspNetCore.Mvc;\n\nnamespace hello.Controllers\n{\n    [Route(\"api\/[controller]\")]\n    [ApiController]\n    public class HelloController : ControllerBase\n    {\n        \/\/ GET api\/values\/5\n        [HttpGet(\"{id}\")]\n        public ActionResult&lt;string&gt; Get(int id)\n        {\n            var text = \"Hello api {id}\";\n            System.Diagnostics.Debug.WriteLine(text);\n            return text;\n        }\n    }\n}\n<\/div>\n\n<\/code><\/pre>\n<p>\u6570\u5024\u306e id \u3092\u6e21\u3055\u308c\u305f\u3089\u300cHello api 100\u300d\u306e\u3088\u3046\u306b\u8fd4\u3059\u3060\u3051\u306e GET \u30e1\u30bd\u30c3\u30c9\u3067\u3059\u3002\u672c\u6765\u306a\u3089\u3070\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u691c\u7d22\u3092\u3057\u3066\u30c7\u30fc\u30bf\u3092\u8fd4\u3059\u3068\u3053\u308d\u3067\u3059\u3002ASP.NET MVC \u306e Web API \u306f\u81ea\u52d5\u3067 JSON \u5f62\u5f0f\u3067\u8fd4\u3059\u306e\u3067\u3059\u304c\u3001\u3072\u3068\u307e\u305a\u3053\u306e\u307e\u307e\u306b\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n<p>\u3082\u3046\u4e00\u3064\u3001XSS \u5bfe\u5fdc\u3092\u3057\u3066\u304a\u304d\u307e\u3059\u3002Scratch 3.0 \u3067\u306f http:\/\/localhost:8601\/ \u3067\u52d5\u304f\u306e\u3067\u3059\u304c\u3001\u4f5c\u6210\u3059\u308b Web API \u306f http:\/\/localhost:5000\/ \u3067\u52d5\u304f\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002\u306a\u306e\u3067\u3001\u30af\u30ed\u30b9\u30b5\u30a4\u30c8\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u5b9f\u884c\u72b6\u614b\u306b\u306a\u308a\u3001\u305d\u306e\u307e\u307e\u3067\u306f\u6b21\u306e\u3088\u3046\u306a\u30a8\u30e9\u30fc\u304c\u3067\u307e\u3059\u3002\u3053\u308c\u306f Chrome \u306e F12 \u3067\u30a8\u30e9\u30fc\u8868\u793a\u3092\u3057\u305f\u3068\u3053\u308d\u3067\u3059\u3002<\/p>\n<p><a href=\"http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2019\/11\/images20191107_09org-1.jpg\"><img decoding=\"async\" src=\"http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2019\/11\/images20191107_09thum-1.jpg\"><\/a><\/p>\n<p>\u3053\u306e\u5bfe\u7b56\u306e\u305f\u3081\u306b\u3001Web API \u5074\u3067 CORS \u5bfe\u7b56\u3092\u3057\u307e\u3059\u3002<br \/>\nMicrosoft.AspNetCore.Cors \u30d1\u30c3\u30b1\u30fc\u30b8\u3092 dotnet \u30b3\u30de\u30f3\u30c9\u3067\u5165\u308c\u305f\u5f8c\u306b\u3001<\/p>\n<pre class=\"hljs\"><code>\n\n<div>dotnet add package Microsoft.AspNetCore.Cors\n<\/div>\n\n<\/code><\/pre>\n<p>Startup.cs \u306b\u6b21\u306e2\u884c\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"hljs\"><code>\n\n<div>using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Threading.Tasks;\nusing Microsoft.AspNetCore.Builder;\nusing Microsoft.AspNetCore.Hosting;\nusing Microsoft.AspNetCore.HttpsPolicy;\nusing Microsoft.AspNetCore.Mvc;\nusing Microsoft.Extensions.Configuration;\nusing Microsoft.Extensions.DependencyInjection;\nusing Microsoft.Extensions.Logging;\nusing Microsoft.Extensions.Options;\n\nnamespace hello\n{\n    public class Startup\n    {\n        public Startup(IConfiguration configuration)\n        {\n            Configuration = configuration;\n        }\n\n        public IConfiguration Configuration { get; }\n\n        \/\/ This method gets called by the runtime. Use this method to add services to the container.\n        public void ConfigureServices(IServiceCollection services)\n        {\n            services.AddCors(); \/\/ CORS \u8ffd\u52a0\n            services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);\n        }\n\n        \/\/ This method gets called by the runtime. Use this method to configure the HTTP request pipeline.\n        public void Configure(IApplicationBuilder app, IHostingEnvironment env)\n        {\n            if (env.IsDevelopment())\n            {\n                app.UseDeveloperExceptionPage();\n            }\n            else\n            {\n                \/\/ The default HSTS value is 30 days. You may want to change this for production scenarios, see https:\/\/aka.ms\/aspnetcore-hsts.\n                app.UseHsts();\n            }\n            app.UseCors(o =&gt; o.AllowAnyOrigin()); \/\/ CORS \u8ffd\u52a0\n\n            app.UseHttpsRedirection();\n            app.UseMvc();\n        }\n    }\n}\n<\/div>\n\n<\/code><\/pre>\n<p>\u3053\u308c\u3067\u5148\u306e\u30a8\u30e9\u30fc\u304c\u306a\u304f\u306a\u308a\u307e\u3059\u3002dotnet run \u3067 Web API \u30b5\u30fc\u30d0\u30fc\u3092\u52d5\u304b\u3057\u305f\u3042\u3068\u306b\u3001\u30d6\u30e9\u30a6\u30b6\u3067 http:\/\/localhost:5000\/api\/Hello\/100 \u306e\u3088\u3046\u306b\u78ba\u8a8d\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<h2 id=\"%E5%AE%9F%E8%A1%8C%E3%81%97%E3%81%A6%E3%81%BF%E3%82%8B\">\u5b9f\u884c\u3057\u3066\u307f\u308b<\/h2>\n<p>Scratch 3.0 \u3068 Web API \u30b5\u30fc\u30d0\u30fc\u3092\u8d77\u52d5\u3057\u305f\u72b6\u614b\u3067\u3001\u6b21\u306e\u3088\u3046\u306b\u30d6\u30ed\u30c3\u30af\u3092\u7d44\u3093\u3067\u307f\u307e\u3059\u3002<\/p>\n<p><a href=\"http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2019\/11\/images20191107_11org-1.jpg\"><img decoding=\"async\" src=\"http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2019\/11\/images20191107_11thum-1.jpg\"><\/a><\/p>\n<p>\u732b\u30b9\u30d7\u30e9\u30a4\u30c8\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068\u3001\u300c\u30ab\u30a6\u30f3\u30bf\u300d\u304c+1\u3055\u308c\u3066\u3001Web API \u304c\u547c\u3073\u51fa\u3055\u308c\u307e\u3059\u3002Web API \u306f\u540c\u671f\u7684\u306b\u547c\u3073\u51fa\u3055\u308c\u308b\u306e\u3067\u3001\u623b\u308a\u5024\u304c\u300c\u7d50\u679c\u300d\u306b\u5165\u3063\u3066\u3001\u732b\u304c\u558b\u308b\u3001\u3068\u3044\u3046\u7c21\u5358\u306a\u3082\u306e\u3067\u3059\u3002<\/p>\n<p>\u5185\u90e8\u7684\u306b\u306f\u3061\u3087\u3063\u3068\u8907\u96d1\u306a\uff08\u3068\u306f\u3044\u3048\u3001Web API\u3092\u547c\u3073\u51fa\u3057\u3066\u3044\u308b\u3060\u3051\u3060\u3051\u3069\uff09\u3053\u3068\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u304c\u3001\u8868\u9762\u7684\u306b\u306f\u30ab\u30a6\u30f3\u30bf\u3092\u4f7f\u3063\u3066\u4f55\u304b\u306e\u300c\u7d50\u679c\u300d\u3092\u53d6\u3063\u3066\u304d\u3066\u3044\u308b\u3060\u3051\u3067\u3059\u3002<\/p>\n<p><a href=\"http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2019\/11\/images20191107_10org-1.jpg\"><img decoding=\"async\" src=\"http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2019\/11\/images20191107_10thum-1.jpg\"><\/a><\/p>\n<p>\u5b9f\u969b\u3001\u732b\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068\u7d50\u679c\u304c\u30ab\u30a6\u30f3\u30c8\u30a2\u30c3\u30d7\u3055\u308c\u3066\u3044\u304f\u306e\u304c\u5206\u304b\u308a\u307e\u3059\u3002\u304d\u3061\u3093\u3068\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u691c\u7d22\u3092\u3057\u3066\u3084\u308c\u3070\u3001ID\u306a\u3069\u3092\u6e21\u3057\u3066 Web API \u7d4c\u7531\u3067\u30c7\u30fc\u30bf\u3092\u5f15\u304d\u51fa\u3059\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<\/p>\n<h2 id=\"%E4%BB%8A%E5%BE%8C%E3%81%AF\">\u4eca\u5f8c\u306f<\/h2>\n<p>fetch \u3092\u4f7f\u3063\u3066 Web API \u3092\u9806\u6b21\u547c\u3073\u51fa\u305b\u308b\u3053\u3068\u304c\u5206\u304b\u3063\u305f\u306e\u3067\u3001<\/p>\n<ul>\n<li>CRUD \u3092\u63c3\u3048\u3066\u3001RESTful \u306a Web API \u306b\u3057\u3066\u304a\u304f\u3002<\/li>\n<li>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u691c\u7d22\u3092\u3059\u308b<\/li>\n<li>\u3084\u308a\u53d6\u308a\u3092 JSON \u5f62\u5f0f\u306b\u3057\u3066\u3001\u30d7\u30ed\u30d1\u30c6\u30a3\u306e\u53d7\u3051\u6e21\u3057\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b<\/li>\n<\/ul>\n<p>\u3092\u5f15\u304d\u7d9a\u304d\u5f8c\u65e5\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Scratch 3.0 \u306e\u62e1\u5f35\u30d6\u30ed\u30c3\u30af\u306e\u4f5c\u308a\u65b9\u304c\u5206\u304b\u3063\u3066\u304d\u305f\u306e\u3067\u3001Web API \u306e\u547c\u3073\u51fa\u3057\u3092\u4f5c\u3063\u3066\u307f\u308b\u3002 \u57fa\u672c\u7684\u306a\u3068\u3053\u308d\u306f\u3001Scratch 3.0\u3067\u30aa\u30ea\u30b8\u30ca\u30eb\u30d6\u30ed\u30c3\u30af\u3092\u3064\u304f\u308d\u3046 &#8211; Qiita \u3068\u540c\u3058\u3067\u3001\u3082 &hellip; <a href=\"http:\/\/www.moonmile.net\/blog\/archives\/10331\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[3],"tags":[],"class_list":["post-10331","post","type-post","status-publish","format-standard","hentry","category-dev"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/posts\/10331","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/comments?post=10331"}],"version-history":[{"count":6,"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/posts\/10331\/revisions"}],"predecessor-version":[{"id":10337,"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/posts\/10331\/revisions\/10337"}],"wp:attachment":[{"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/media?parent=10331"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/categories?post=10331"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/tags?post=10331"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}