Created
October 29, 2018 02:31
-
-
Save taktamur/00b0714bfa893a92dd6131482c10420b to your computer and use it in GitHub Desktop.
時刻判定をしてGHKitのAPIを呼び出すNode-RED
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"id": "30155774.268828", | |
"type": "tab", | |
"label": "フロー 1", | |
"disabled": false, | |
"info": "" | |
}, | |
{ | |
"id": "e06cf7c7.32e1c8", | |
"type": "tls-config", | |
"z": "", | |
"name": "", | |
"cert": "", | |
"key": "", | |
"ca": "", | |
"certname": "", | |
"keyname": "", | |
"caname": "", | |
"servername": "", | |
"verifyservercert": true | |
}, | |
{ | |
"id": "150235c9.904b8a", | |
"type": "http in", | |
"z": "30155774.268828", | |
"name": "IFTTTからの受け口", | |
"url": "webhook", | |
"method": "post", | |
"upload": false, | |
"swaggerDoc": "", | |
"x": 98.5, | |
"y": 168, | |
"wires": [ | |
[ | |
"8cafc4b8.23cbc8", | |
"1e41a040.7a5e7", | |
"849dd031.fd7d4" | |
] | |
] | |
}, | |
{ | |
"id": "849dd031.fd7d4", | |
"type": "http response", | |
"z": "30155774.268828", | |
"name": "", | |
"statusCode": "", | |
"headers": {}, | |
"x": 410.5, | |
"y": 153, | |
"wires": [] | |
}, | |
{ | |
"id": "b36c395a.20a7a8", | |
"type": "inject", | |
"z": "30155774.268828", | |
"name": "デバッグ実行", | |
"topic": "", | |
"payload": "{\"message\":\"vgchj5y2i4e てすつ\"}", | |
"payloadType": "json", | |
"repeat": "", | |
"crontab": "", | |
"once": false, | |
"onceDelay": 0.1, | |
"x": 134.5, | |
"y": 401, | |
"wires": [ | |
[ | |
"8cafc4b8.23cbc8" | |
] | |
] | |
}, | |
{ | |
"id": "1e41a040.7a5e7", | |
"type": "debug", | |
"z": "30155774.268828", | |
"name": "", | |
"active": true, | |
"tosidebar": true, | |
"console": false, | |
"tostatus": false, | |
"complete": "payload", | |
"x": 607.5, | |
"y": 236, | |
"wires": [] | |
}, | |
{ | |
"id": "8cafc4b8.23cbc8", | |
"type": "function", | |
"z": "30155774.268828", | |
"name": "時刻チェック", | |
"func": "var utc = new Date();\n//現在時刻とUTCの時差を求める。ハワイなら600分 * 60秒 * 1000ミリ秒\nvar offset = utc.getTimezoneOffset() * 60 * 1000;\nutc = new Date(utc.getTime() + offset);\n\nvar timeJP = new Date(utc.getTime() + 9 * 60 * 60 * 1000);\nvar jpHour = timeJP.getHours();\n\nif( 8<jpHour && jpHour<23 ){\n return msg;\n}else{\n return\n}\nreturn msg;", | |
"outputs": 1, | |
"noerr": 0, | |
"x": 203.5, | |
"y": 252, | |
"wires": [ | |
[ | |
"d4acb777.a16f98", | |
"1e41a040.7a5e7" | |
] | |
] | |
}, | |
{ | |
"id": "d4acb777.a16f98", | |
"type": "http request", | |
"z": "30155774.268828", | |
"name": "GHKitのwebhook呼び出し", | |
"method": "POST", | |
"ret": "obj", | |
"url": "https://ifttt.ghkit.jp/", | |
"tls": "e06cf7c7.32e1c8", | |
"x": 317.5, | |
"y": 331, | |
"wires": [ | |
[ | |
"1e41a040.7a5e7" | |
] | |
] | |
} | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment