BEFORE YOU USE THIS, edit the what I want to watch
node.
(Press the original inject
node and pick a show which is about to start and fill in the details in the new inject
node.)
MODIFIED CODE
This is what I have - EXAMPLE!
[{"id":"ed5076c00dd272c1","type":"inject","z":"0918ee609bf69fc7","name":"Get guide with tis for initial shows/times","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":1250,"y":3660,"wires":[["5e655edb9097fa89"]]},{"id":"5e655edb9097fa89","type":"http request","z":"0918ee609bf69fc7","name":"","method":"GET","ret":"txt","paytoqs":"ignore","url":"https://www.foxtel.com.au/now/tv-guide/grid","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[{"keyType":"Accept","keyValue":"","valueType":"text/html","valueValue":""},{"keyType":"User-Agent","keyValue":"","valueType":"other","valueValue":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:121.0) Gecko/20100101 Firefox/121.0"}],"x":1170,"y":3830,"wires":[["a63537a59a74e6d8"]]},{"id":"44afecd5a248492c","type":"debug","z":"0918ee609bf69fc7","name":"RAW guide","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":2230,"y":3830,"wires":[]},{"id":"220c62f5fc4e5590","type":"function","z":"0918ee609bf69fc7","name":"function 3","func":"let movies = []\n\n\nmsg.payload = msg.payload.channel.forEach((channel, index) => {\n msg.payload.movie[index].forEach((m, i) => {\n movies.push(\n {\n channel: channel[0].trim(),\n title: m.trim(),\n time: msg.payload.time[index][i]\n }\n )\n })\n\n})\n\nmsg.payload = movies;\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":2060,"y":3830,"wires":[["44afecd5a248492c","8748082553887665"]]},{"id":"a63537a59a74e6d8","type":"html","z":"0918ee609bf69fc7","name":"channel","property":"payload","outproperty":"payload","tag":".epg-programs-row","ret":"html","as":"single","x":1320,"y":3830,"wires":[["457ee776da9ae1d7"]]},{"id":"ad708ba92b036065","type":"html","z":"0918ee609bf69fc7","name":"movie","property":"payload","outproperty":"payload","tag":".epg-cell .epg-program-name","ret":"text","as":"single","x":1610,"y":3830,"wires":[["1a6bf591eac4d83c"]]},{"id":"f8c1d69fa4e024fe","type":"html","z":"0918ee609bf69fc7","name":"time","property":"payload","outproperty":"payload","tag":" .epg-cell .sr-only","ret":"html","as":"single","x":1610,"y":3890,"wires":[["9b51e93122fde748"]]},{"id":"cb31bdf8b963400f","type":"html","z":"0918ee609bf69fc7","name":"channel","property":"payload","outproperty":"payload","tag":".epg-channel-callout-number","ret":"text","as":"single","x":1600,"y":3770,"wires":[["ea1a9f8b643d504e"]]},{"id":"6544f9aafdf56d22","type":"join","z":"0918ee609bf69fc7","name":"","mode":"auto","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"3","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":1790,"y":3770,"wires":[["8610439ee46e499e"]]},{"id":"ea1a9f8b643d504e","type":"change","z":"0918ee609bf69fc7","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"channel","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1695,"y":3770,"wires":[["6544f9aafdf56d22"]],"l":false},{"id":"1a6bf591eac4d83c","type":"change","z":"0918ee609bf69fc7","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"movie","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1695,"y":3830,"wires":[["0b0804130ade5cbd"]],"l":false},{"id":"9b51e93122fde748","type":"change","z":"0918ee609bf69fc7","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"time","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1695,"y":3890,"wires":[["e9f30cc17a2d7ea0"]],"l":false},{"id":"457ee776da9ae1d7","type":"split","z":"0918ee609bf69fc7","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":1450,"y":3830,"wires":[["cb31bdf8b963400f","ad708ba92b036065","f8c1d69fa4e024fe"]]},{"id":"0b0804130ade5cbd","type":"join","z":"0918ee609bf69fc7","name":"","mode":"auto","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"3","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":1790,"y":3830,"wires":[["8610439ee46e499e"]]},{"id":"e9f30cc17a2d7ea0","type":"join","z":"0918ee609bf69fc7","name":"","mode":"auto","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"3","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":1790,"y":3890,"wires":[["8610439ee46e499e"]]},{"id":"8610439ee46e499e","type":"join","z":"0918ee609bf69fc7","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"3","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":1930,"y":3830,"wires":[["220c62f5fc4e5590"]]},{"id":"8748082553887665","type":"link out","z":"0918ee609bf69fc7","name":"link out 9","mode":"link","links":["d439893258352a06"],"x":2175,"y":3870,"wires":[]},{"id":"d439893258352a06","type":"link in","z":"0918ee609bf69fc7","name":"link in 6","links":["8748082553887665"],"x":1125,"y":3990,"wires":[["f4bc4ef5ab5fa925"]]},{"id":"5c9d4ab2ac8e1167","type":"inject","z":"0918ee609bf69fc7","name":"What I want to watch","props":[{"p":"payload"},{"p":"channel","v":"101","vt":"str"},{"p":"show","v":"Blue Bloods","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":1190,"y":3720,"wires":[["743d14e4513b57ba"]]},{"id":"743d14e4513b57ba","type":"change","z":"0918ee609bf69fc7","name":"Set flow values","rules":[{"t":"set","p":"channel","pt":"flow","to":"channel","tot":"msg"},{"t":"set","p":"show","pt":"flow","to":"show","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1420,"y":3720,"wires":[["5e655edb9097fa89"]]},{"id":"f4bc4ef5ab5fa925","type":"switch","z":"0918ee609bf69fc7","name":"Channel","property":"payload[0].channel","propertyType":"msg","rules":[{"t":"eq","v":"channel","vt":"flow"}],"checkall":"true","repair":false,"outputs":1,"x":1260,"y":3990,"wires":[["2ea4ecf231e91d70"]]},{"id":"2ea4ecf231e91d70","type":"switch","z":"0918ee609bf69fc7","name":"Show","property":"payload[2].title","propertyType":"msg","rules":[{"t":"eq","v":"show","vt":"flow"}],"checkall":"true","repair":false,"outputs":1,"x":1430,"y":3990,"wires":[["107b852cf1cd2865","cd9fc6e449301663"]]},{"id":"107b852cf1cd2865","type":"debug","z":"0918ee609bf69fc7","name":"debug 303","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1620,"y":3990,"wires":[]},{"id":"cd9fc6e449301663","type":"template","z":"0918ee609bf69fc7","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{{show}} on {{channel}} at {{payload[2].time}}","output":"str","x":1610,"y":4030,"wires":[["5539c595e0f631fb"]]},{"id":"5539c595e0f631fb","type":"debug","z":"0918ee609bf69fc7","name":"debug 304","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1790,"y":4030,"wires":[]}]
I've tweaked it so now I get the channel NUMBER - not name.
(No offense)
So now I will have to SPLIT the message from your code before it gets to my code (lower part)
Then I parse each message to match that for which I am searching.
Yes?