2021年8月19日 星期四

使用氣象局opendata資料 依據22縣市的下拉式選單取得天氣狀況

使用氣象局opendata資料 依據22縣市的下拉式選單取得天氣狀況






 





[{"id":"6dfe150e.34997c","type":"inject","z":"76e4593f.be8138","name":"","props":[{"p":"payload","v":"","vt":"date"},{"p":"topic","v":"","vt":"string"}],"repeat":"7200","crontab":"","once":false,"topic":"","payload":"","payloadType":"date","x":120,"y":60,"wires":[["c2230b66.657a58"]]},{"id":"6fb353fd.56cefc","type":"debug","z":"76e4593f.be8138","name":"temp request result","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":509,"y":62,"wires":[]},{"id":"cb8f5638.8c35e8","type":"function","z":"76e4593f.be8138","name":"set global temp","func":"context.global.temp=msg.payload.records;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":500,"y":100,"wires":[["58bbd98d.c23908"]]},{"id":"b389c015.761a2","type":"http in","z":"76e4593f.be8138","name":"city","url":"/city","method":"get","upload":false,"swaggerDoc":"","x":90,"y":420,"wires":[["fcffbd85.31821"]]},{"id":"74e7f25f.d88afc","type":"http response","z":"76e4593f.be8138","name":"http out","x":620,"y":420,"wires":[]},{"id":"fcffbd85.31821","type":"function","z":"76e4593f.be8138","name":"city name to number","func":"\nvar cityname;\n\ncontext.global.locationnumber=0;\ntry {\n    cityname=msg.payload.cityname;\n   \n   if(cityname.indexOf('嘉義縣')!=-1 ||cityname.indexOf('嘉義縣')!=-1 )\n{\n    context.global.locationnumber=0;\n   \n}\nelse if(cityname.indexOf('新北市')!=-1)\n{\n    context.global.locationnumber=1;\n   \n}\nelse if(cityname.indexOf('嘉義市')!=-1) //\n{\n    context.global.locationnumber=2;\n   \n}\nelse if(cityname.indexOf('新竹縣')!=-1 || cityname.indexOf('新竹縣')!=-1) \n{\n    context.global.locationnumber= 3;\n   \n}\nelse if(cityname.indexOf('新竹市')!=-1 || cityname.indexOf('新竹市')!=-1) \n{\n    context.global.locationnumber= 4;\n   \n}\nelse if(cityname.indexOf('臺北')!=-1 || cityname.indexOf('台北')!=-1) \n{\n    context.global.locationnumber= 5 ;\n   \n}\nelse if(cityname.indexOf('臺南')!=-1 || cityname.indexOf('台南')!=-1)  \n{\n    context.global.locationnumber= 6 ;\n   \n}\nelse if(cityname.indexOf('宜蘭')!=-1 ) \n{\n    context.global.locationnumber= 7 ;\n   \n}\nelse if(cityname.indexOf('苗栗')!=-1 ) \n{\n    context.global.locationnumber= 8 ;\n   \n}\n\nelse if(cityname.indexOf('雲林')!=-1 ) \n{\n    context.global.locationnumber= 9 ;\n   \n}\nelse if(cityname.indexOf('花蓮')!=-1 ) \n{\n    context.global.locationnumber= 10 ;\n   \n}\n\nelse if(cityname.indexOf('臺中')!=-1 || cityname.indexOf('台中')!=-1) \n{\n    context.global.locationnumber= 11 ;\n   \n}\n\nelse if(cityname.indexOf('臺東')!=-1 || cityname.indexOf('台東')!=-1) \n{\n    context.global.locationnumber= 12 ;\n   \n}\nelse if(cityname.indexOf('桃園')!=-1 || cityname.indexOf('桃園')!=-1) \n{\n    context.global.locationnumber= 13 ;\n   \n}\nelse if(cityname.indexOf('南投')!=-1 || cityname.indexOf('南投')!=-1) \n{\n    context.global.locationnumber= 14 ;\n   \n}\nelse if(cityname.indexOf('高雄')!=-1 || cityname.indexOf('高雄')!=-1) \n{\n    context.global.locationnumber= 15 ;\n   \n}\n\nelse if(cityname.indexOf('金門')!=-1 || cityname.indexOf('金門')!=-1) \n{\n    context.global.locationnumber= 16 ;\n   \n}\n\nelse if(cityname.indexOf('屏東')!=-1 || cityname.indexOf('屏東')!=-1) \n{\n    context.global.locationnumber= 17 ;\n   \n}\n\nelse if(cityname.indexOf('基隆')!=-1 || cityname.indexOf('基隆')!=-1) \n{\n    context.global.locationnumber= 18 ;\n   \n}\nelse if(cityname.indexOf('澎湖')!=-1 || cityname.indexOf('澎湖')!=-1) \n{\n    context.global.locationnumber= 19 ;\n   \n}\nelse if(cityname.indexOf('彰化')!=-1 || cityname.indexOf('彰化')!=-1) \n{\n    context.global.locationnumber= 20;\n   \n}\n\n\n\nelse if(cityname.indexOf('連江')!=-1 ) \n{\n    context.global.locationnumber= 21 ;\n   \n}\n\nelse  \n{\n    context.global.locationnumber= 11 ;\n   \n}\n   \n   \n}\n\ncatch(err) {\n    cityname=\"台中\";\n    context.global.locationnumber=11;\n}\n\n\n msg.payload= context.global.locationnumber;\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":260,"y":420,"wires":[["c9740d7f.e96bd","9fb41815.dbdcc8"]]},{"id":"c9740d7f.e96bd","type":"debug","z":"76e4593f.be8138","name":"city name to number result","active":true,"tosidebar":true,"console":false,"complete":"payload","statusVal":"","statusType":"auto","x":520,"y":460,"wires":[]},{"id":"7f46f572.4708ec","type":"http in","z":"76e4593f.be8138","name":"tempjson","url":"/tempjson","method":"get","swaggerDoc":"","x":100,"y":200,"wires":[["ecf2189c.210bf8"]]},{"id":"20dc5b2f.f22514","type":"http response","z":"76e4593f.be8138","name":"http out","x":480,"y":200,"wires":[]},{"id":"ecf2189c.210bf8","type":"function","z":"76e4593f.be8138","name":"show raw data","func":"//var loc=msg.payload.loc;\n//var rawdata=context.global.temp;\n//msg.payload=rawdata.cwbopendata.dataset[0].location;\n\nmsg.payload=context.global.temp;\nreturn msg;\n\n/*\nvar locationName=rawdata.cwbopendata.dataset[0].location[loc].locationName[0];\nvar period0max=rawdata.cwbopendata.dataset[0].location[loc].weatherElement[1].time[0].parameter[0].parameterName[0];\nvar period0min=rawdata.cwbopendata.dataset[0].location[loc].weatherElement[2].time[0].parameter[0].parameterName[0];\nvar period0start=rawdata.cwbopendata.dataset[0].location[loc].weatherElement[1].time[0].startTime[0];\nvar period0end=rawdata.cwbopendata.dataset[0].location[loc].weatherElement[1].time[0].endTime[0];\n\nvar  starthourtemp= period0start.split(\"T\");\nvar starthour=starthourtemp[1].split(\":\")[0];\nvar  endhourtemp= period0end.split(\"T\");\nvar endhour=endhourtemp[1].split(\":\")[0];\n\nmsg.payload={\"locationName\":locationName,\"time\":starthour+\"-\"+endhour, \"max\":period0max,\n\"min\":period0min};\nreturn msg;\n*/\n\n/*if(time.getHours()<18)\n{\nmsg.payload={\"locationName\":locationName,\"todaymax\":period1max, \"todaymin\":period1min,\n             \"tonightmax\":period2max, \"tonightmin\":period2min,\"tomorrowmax\":period3max, \"tomorrowmin\":period3min};\n}\nelse\nmsg.payload={\"locationName\":locationName,\"tonightmax\":period1max, \"tonightmin\":period1min,\n             \"todaymax\":period2max, \"tonightmin\":period2min,\"tomorrowmax\":period3max, \"tomorrowmin\":period3min};\n}\n\n*/\n\n\n\n\n//msg.payload=rawdata.cwbopendata.dataset[0].location[loc].weatherElement[1].time[1];\n\n\n\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":320,"y":200,"wires":[["20dc5b2f.f22514","6dd2ec78.7f5ea4"]]},{"id":"6dd2ec78.7f5ea4","type":"debug","z":"76e4593f.be8138","name":"temp data process","active":true,"console":"false","complete":"payload","x":530,"y":240,"wires":[]},{"id":"1e7d57a7.9bceb8","type":"function","z":"76e4593f.be8138","name":"List locationname","func":"var rawdata=context.global.temp;\nvar location=rawdata.location;\nvar citynumber=location.length;\nvar cityarray=[];\nvar i;\nfor (i=0; i<citynumber;i++)\n{\n    cityarray[i]=location[i].locationName;\n}\n\n msg.payload=cityarray;\n\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":290,"y":320,"wires":[["16bc7465.39076c","58b981c3.6af63"]]},{"id":"16bc7465.39076c","type":"debug","z":"76e4593f.be8138","name":"List all locationnames ","active":true,"console":"false","complete":"payload","x":560,"y":360,"wires":[]},{"id":"9fb41815.dbdcc8","type":"function","z":"76e4593f.be8138","name":"max min","func":"var loc=msg.payload;\nvar rawdata=context.global.temp;\nvar locationName=rawdata.location[loc].locationName;\nvar period0max=rawdata.location[loc].weatherElement[4].time[2].parameter.parameterName;\nvar period0min=rawdata.location[loc].weatherElement[2].time[2].parameter.parameterName;\nvar period0start=rawdata.location[loc].weatherElement[4].time[2].startTime;\nvar period0end = rawdata.location[loc].weatherElement[2].time[2].endTime;\n\n\nmsg.payload={\"locationName地點\":locationName,\"time開始時間\":period0start+\"-迄\"+period0end, \"max最高溫度\":period0max,\n\"min最低溫度\":period0min};\n\n//msg.payload={\"locationName\":locationName,\"max\":period0max,\"min\":period0min};\n\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":460,"y":420,"wires":[["74e7f25f.d88afc"]]},{"id":"f862e33a.af1bd","type":"debug","z":"76e4593f.be8138","name":"report result","active":true,"console":"false","complete":"payload","x":630,"y":640,"wires":[]},{"id":"7aaca32e.e7578c","type":"inject","z":"76e4593f.be8138","name":"inject city options","props":[{"p":"payload","v":"","vt":"date"},{"p":"topic","v":"","vt":"string"}],"repeat":"7200","crontab":"","once":false,"topic":"","payload":"","payloadType":"date","x":150,"y":520,"wires":[["6064e36f.967cac"]]},{"id":"6064e36f.967cac","type":"function","z":"76e4593f.be8138","name":"set options","func":"var rawdata=context.global.temp;\n\nvar location=rawdata.location;\nvar citynumber=location.length;\nvar i;\n\nvar cityarray=[];\nfor (i=0; i<citynumber;i++)\n{\n    cityarray[i]=location[i].locationName;\n}\nmsg.options=cityarray;\nreturn msg;\n\n/*\nvar locationName=rawdata.cwbopendata.dataset[0].location[loc].locationName[0];\nvar period0max=rawdata.cwbopendata.dataset[0].location[loc].weatherElement[1].time[0].parameter[0].parameterName[0];\nvar period0min=rawdata.cwbopendata.dataset[0].location[loc].weatherElement[2].time[0].parameter[0].parameterName[0];\nvar period0start=rawdata.cwbopendata.dataset[0].location[loc].weatherElement[1].time[0].startTime[0];\nvar period0end=rawdata.cwbopendata.dataset[0].location[loc].weatherElement[1].time[0].endTime[0];\n\nvar  starthourtemp= period0start.split(\"T\");\nvar starthour=starthourtemp[1].split(\":\")[0];\nvar  endhourtemp= period0end.split(\"T\");\nvar endhour=endhourtemp[1].split(\":\")[0];\n\nmsg.payload={\"locationName\":locationName,\"time\":starthour+\"-\"+endhour, \"max\":period0max,\n\"min\":period0min};\nreturn msg;\n*/\n\n/*if(time.getHours()<18)\n{\nmsg.payload={\"locationName\":locationName,\"todaymax\":period1max, \"todaymin\":period1min,\n             \"tonightmax\":period2max, \"tonightmin\":period2min,\"tomorrowmax\":period3max, \"tomorrowmin\":period3min};\n}\nelse\nmsg.payload={\"locationName\":locationName,\"tonightmax\":period1max, \"tonightmin\":period1min,\n             \"todaymax\":period2max, \"tonightmin\":period2min,\"tomorrowmax\":period3max, \"tomorrowmin\":period3min};\n}\n\n*/\n\n\n\n\n//msg.payload=rawdata.cwbopendata.dataset[0].location[loc].weatherElement[1].time[1];\n\n\n\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":330,"y":520,"wires":[["e5f3a01.2868c6","72a0086d.a154c8"]]},{"id":"f2b37c12.b7a4d","type":"inject","z":"76e4593f.be8138","name":"inject city","props":[{"p":"payload","v":"","vt":"date"},{"p":"topic","v":"","vt":"string"}],"repeat":"","crontab":"","once":false,"topic":"","payload":"","payloadType":"date","x":120,"y":320,"wires":[["1e7d57a7.9bceb8"]]},{"id":"2a7c547e.122b1c","type":"function","z":"76e4593f.be8138","name":"report","func":"var loc=msg.payload;\nvar rawdata=context.global.temp;\nvar locationName=rawdata.location[loc].locationName;\nvar period0max=rawdata.location[loc].weatherElement[4].time[2].parameter.parameterName;\nvar period0min=rawdata.location[loc].weatherElement[2].time[2].parameter.parameterName;\nvar period0start=rawdata.location[loc].weatherElement[4].time[2].startTime;\nvar period0end = rawdata.location[loc].weatherElement[2].time[2].endTime;\n\nmsg.payload={地點:locationName,開始時間:period0start+\"-迄\"+period0end, \"最高溫度\":period0max,\n\"℃ 最低溫度\":period0min +  \"℃  \"};\n//msg.payload={\"locationName\":locationName,\"max\":period0max,\"min\":period0min};\nreturn msg;\n\n\n\n//var loc=msg.payload;\n//var rawdata=context.global.temp;\n//var locationName=rawdata.cwbopendata.dataset[0].location[loc].locationName[0];\n//var period0max=rawdata.cwbopendata.dataset[0].location[loc].weatherElement[1].time[0].parameter[0].parameterName[0];\n//var period0min=rawdata.cwbopendata.dataset[0].location[loc].weatherElement[2].time[0].parameter[0].parameterName[0];\n//var period0start=rawdata.cwbopendata.dataset[0].location[loc].weatherElement[1].time[0].startTime[0];\n//var period0end=rawdata.cwbopendata.dataset[0].location[loc].weatherElement[1].time[0].endTime[0];\n\n//var  starthourtemp= period0start.split(\"T\");\n//var starthour=starthourtemp[1].split(\":\")[0];\n//var  endhourtemp= period0end.split(\"T\");\n//var endhour=endhourtemp[1].split(\":\")[0];\n\n//msg.payload=locationName+starthour+\"到\"+endhour+\"點溫度最低\"+period0min+\"度最高\"+period0max+\"度\";\n//return msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":470,"y":640,"wires":[["f862e33a.af1bd","838e7155.243b1"]]},{"id":"9d567c76.3deee","type":"debug","z":"76e4593f.be8138","name":"selected city ","active":true,"console":"false","complete":"payload","x":630,"y":580,"wires":[]},{"id":"e5f3a01.2868c6","type":"ui_dropdown","z":"76e4593f.be8138","name":"","label":"city options","tooltip":"","place":"Select city","group":"e045c1fa.7a743","order":0,"width":0,"height":0,"passthru":true,"multiple":false,"options":[{"label":"嘉義縣","value":"0","type":"str"},{"label":"新北市","value":"1","type":"str"},{"label":"嘉義市","value":"2","type":"str"},{"label":"新竹縣","value":"3","type":"str"},{"label":"新竹市","value":"4","type":"str"},{"label":"臺北市","value":"5","type":"str"},{"label":"臺南市","value":"6","type":"str"},{"label":"宜蘭縣","value":"7","type":"str"},{"label":"苗栗縣","value":"8","type":"str"},{"label":"雲林縣","value":"9","type":"str"},{"label":"花蓮縣","value":"10","type":"str"},{"label":"臺中市","value":"11","type":"str"},{"label":"臺東縣","value":"12","type":"str"},{"label":"桃園市","value":"13","type":"str"},{"label":"南投縣","value":"14","type":"str"},{"label":"高雄市","value":"15","type":"str"},{"label":"金門縣","value":"16","type":"str"},{"label":"屏東縣","value":"17","type":"str"},{"label":"基隆市","value":"18","type":"str"},{"label":"澎湖縣","value":"19","type":"str"},{"label":"彰化縣","value":"20","type":"str"},{"label":"連江縣","value":"21","type":"str"}],"payload":"","topic":"","x":450,"y":580,"wires":[["9d567c76.3deee","5913e9c6.31c868"]]},{"id":"838e7155.243b1","type":"ui_text","z":"76e4593f.be8138","group":"e045c1fa.7a743","order":0,"width":0,"height":0,"name":"","label":"","format":"{{msg.payload}}","layout":"row-left","x":610,"y":680,"wires":[]},{"id":"c2230b66.657a58","type":"http request","z":"76e4593f.be8138","name":"","method":"GET","ret":"obj","paytoqs":"ignore","url":"https://opendata.cwb.gov.tw/api/v1/rest/datastore/F-C0032-001?Authorization=CWB-401C25FFF-1224-42150-B9D9-3735AAE117DBF&format=JSON","tls":"","persist":false,"proxy":"","authType":"","x":320,"y":60,"wires":[["6fb353fd.56cefc","cb8f5638.8c35e8"]]},{"id":"a0d2d442.2ca268","type":"comment","z":"76e4593f.be8138","name":"","info":"GET\n\nhttps://opendata.cwb.gov.tw/api/v1/rest/datastore/F-C0032-001?Authorization=CWB-40C125FFF-1224-4250-B9D9-3735A1AE117DBF&format=JSON","x":310,"y":100,"wires":[]},{"id":"58bbd98d.c23908","type":"debug","z":"76e4593f.be8138","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":670,"y":100,"wires":[]},{"id":"58b981c3.6af63","type":"function","z":"76e4593f.be8138","name":"set global temploction","func":"context.global.temploction=msg.payload;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":520,"y":320,"wires":[["3165e6ac.b71e9a"]]},{"id":"3165e6ac.b71e9a","type":"debug","z":"76e4593f.be8138","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":710,"y":320,"wires":[]},{"id":"72a0086d.a154c8","type":"debug","z":"76e4593f.be8138","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"options","targetType":"msg","statusVal":"","statusType":"auto","x":510,"y":520,"wires":[]},{"id":"5913e9c6.31c868","type":"function","z":"76e4593f.be8138","name":"city name to number","func":"\nvar cityname;\n\ncontext.global.locationnumber=0;\ntry {\n    cityname=msg.payload;\n   \n   if(cityname.indexOf('嘉義縣')!=-1 ||cityname.indexOf('嘉義縣')!=-1 )\n{\n    context.global.locationnumber=0;\n   \n}\nelse if(cityname.indexOf('新北市')!=-1)\n{\n    context.global.locationnumber=1;\n   \n}\nelse if(cityname.indexOf('嘉義市')!=-1) //\n{\n    context.global.locationnumber=2;\n   \n}\nelse if(cityname.indexOf('新竹縣')!=-1 || cityname.indexOf('新竹縣')!=-1) \n{\n    context.global.locationnumber= 3;\n   \n}\nelse if(cityname.indexOf('新竹市')!=-1 || cityname.indexOf('新竹市')!=-1) \n{\n    context.global.locationnumber= 4;\n   \n}\nelse if(cityname.indexOf('臺北')!=-1 || cityname.indexOf('台北')!=-1) \n{\n    context.global.locationnumber= 5 ;\n   \n}\nelse if(cityname.indexOf('臺南')!=-1 || cityname.indexOf('台南')!=-1)  \n{\n    context.global.locationnumber= 6 ;\n   \n}\nelse if(cityname.indexOf('宜蘭')!=-1 ) \n{\n    context.global.locationnumber= 7 ;\n   \n}\nelse if(cityname.indexOf('苗栗')!=-1 ) \n{\n    context.global.locationnumber= 8 ;\n   \n}\n\nelse if(cityname.indexOf('雲林')!=-1 ) \n{\n    context.global.locationnumber= 9 ;\n   \n}\nelse if(cityname.indexOf('花蓮')!=-1 ) \n{\n    context.global.locationnumber= 10 ;\n   \n}\n\nelse if(cityname.indexOf('臺中')!=-1 || cityname.indexOf('台中')!=-1) \n{\n    context.global.locationnumber= 11 ;\n   \n}\n\nelse if(cityname.indexOf('臺東')!=-1 || cityname.indexOf('台東')!=-1) \n{\n    context.global.locationnumber= 12 ;\n   \n}\nelse if(cityname.indexOf('桃園')!=-1 || cityname.indexOf('桃園')!=-1) \n{\n    context.global.locationnumber= 13 ;\n   \n}\nelse if(cityname.indexOf('南投')!=-1 || cityname.indexOf('南投')!=-1) \n{\n    context.global.locationnumber= 14 ;\n   \n}\nelse if(cityname.indexOf('高雄')!=-1 || cityname.indexOf('高雄')!=-1) \n{\n    context.global.locationnumber= 15 ;\n   \n}\n\nelse if(cityname.indexOf('金門')!=-1 || cityname.indexOf('金門')!=-1) \n{\n    context.global.locationnumber= 16 ;\n   \n}\n\nelse if(cityname.indexOf('屏東')!=-1 || cityname.indexOf('屏東')!=-1) \n{\n    context.global.locationnumber= 17 ;\n   \n}\n\nelse if(cityname.indexOf('基隆')!=-1 || cityname.indexOf('基隆')!=-1) \n{\n    context.global.locationnumber= 18 ;\n   \n}\nelse if(cityname.indexOf('澎湖')!=-1 || cityname.indexOf('澎湖')!=-1) \n{\n    context.global.locationnumber= 19 ;\n   \n}\nelse if(cityname.indexOf('彰化')!=-1 || cityname.indexOf('彰化')!=-1) \n{\n    context.global.locationnumber= 20;\n   \n}\n\n\n\nelse if(cityname.indexOf('連江')!=-1 ) \n{\n    context.global.locationnumber= 21 ;\n   \n}\n\nelse  \n{\n    context.global.locationnumber= 11 ;\n   \n}\n   \n   \n}\n\ncatch(err) {\n    cityname=\"台中\";\n    context.global.locationnumber=11;\n}\n\n\n msg.payload= context.global.locationnumber;\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":280,"y":640,"wires":[["2a7c547e.122b1c","e2d638ea.5fe9f8"]]},{"id":"e2d638ea.5fe9f8","type":"debug","z":"76e4593f.be8138","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":430,"y":700,"wires":[]},{"id":"e045c1fa.7a743","type":"ui_group","name":"City temperature","tab":"55628e0d.1afc3","order":1,"disp":true,"width":"6"},{"id":"55628e0d.1afc3","type":"ui_tab","name":"Home","icon":"dashboard"}]

沒有留言:

張貼留言

Messaging API作為替代方案

  LINE超好用功能要沒了!LINE Notify明年3月底終止服務,有什麼替代方案? LINE Notify將於2025年3月31日結束服務,官方建議改用Messaging API作為替代方案。 //CHANNEL_ACCESS_TOKEN = 'Messaging ...