原理简述
- 通过request节点访问论坛
- 通过html节点的css选择器 输出想要的内容 并存到flow变量当中.
- function整理内容 排除发帖时间过久的帖子
- 后续TTS或信息推送等方式输出内容
安装wol节点
{"id":"67fdc8f6.dc63a8","type":"ioBroker in","z":"ea32e082.f03d4","name":"单击书房无线按钮","topic":"mihome.0.devices.switch_158d00028ca2ef.click","payloadType":"object","onlyack":true,"func":"all","gap":"","x":390,"y":1500,"wires":"9d0138a.19600c8","25e67dcc.e8fc72","758037a.30a9dc8","2d771952.0844d6","e2627606.988938"]]},{"id":"9d0138a.19600c8","type":"wake on lan","z":"ea32e082.f03d4","mac":"74:D4:35:8A:64:9A","host":"192.168.2.148","name":"wol唤醒电脑","x":690,"y":1320,"wires":]},{"id":"25e67dcc.e8fc72","type":"http request","z":"ea32e082.f03d4","name":"iobroker论坛","method":"GET","ret":"txt","paytoqs":false,"url":"/c/7-category"52f0ff79.c0209"]]},{"id":"52f0ff79.c0209","type":"html","z":"ea32e082.f03d4","name":"筛选帖子标题","property":"payload","outproperty":"payload","tag":"a[class=\"s xst\"]","ret":"text","as":"single","x":840,"y":1400,"wires":"90dea37.9d8c66"]]},{"id":"758037a.30a9dc8","type":"http request","z":"ea32e082.f03d4","name":"iobroker论坛","method":"GET","ret":"txt","paytoqs":false,"url":"/c/7-category"f55b2942.d17848"]]},{"id":"f55b2942.d17848","type":"html","z":"ea32e082.f03d4","name":"筛选帖子作者","property":"payload","outproperty":"payload","tag":"span[style=\"margin-left: 0;\"]","ret":"text","as":"single","x":860,"y":1480,"wires":"df45c2b9.36cf4"]]},{"id":"2d771952.0844d6","type":"http request","z":"ea32e082.f03d4","name":"iobroker论坛","method":"GET","ret":"txt","paytoqs":false,"url":"/c/7-category"d4b878ac.331678"]]},{"id":"d4b878ac.331678","type":"html","z":"ea32e082.f03d4","name":"筛选 发帖时间","property":"payload","outproperty":"payload","tag":"span[style=\"margin-left: 5px;\"]","ret":"text","as":"single","x":880,"y":1560,"wires":"fb572d83.7e069"]]},{"id":"90dea37.9d8c66","type":"change","z":"ea32e082.f03d4","name":"","rules":{"t":"move","p":"payload","pt":"msg","to":"topic_name","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":1070,"y":1400,"wires":]]},{"id":"df45c2b9.36cf4","type":"change","z":"ea32e082.f03d4","name":"","rules":{"t":"move","p":"payload","pt":"msg","to":"topic_author","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":1090,"y":1480,"wires":]]},{"id":"fb572d83.7e069","type":"change","z":"ea32e082.f03d4","name":"","rules":{"t":"move","p":"payload","pt":"msg","to":"topic_time","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":1130,"y":1560,"wires":]]},{"id":"b13e7f16.6f52d","type":"inject","z":"ea32e082.f03d4","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":750,"y":1700,"wires":"772f5d1a.601354"]]},{"id":"772f5d1a.601354","type":"function","z":"ea32e082.f03d4","name":"筛选帖子主题作者及时间","func":"var topic_time = flow.get('topic_time');\nvar topic_name = flow.get('topic_name');\nvar topic_author = flow.get('topic_author');\nmsg.payload = ];\nfor (var key = 0; key < topic_time.length; key++){\n if (topic_time[key].search(\"2019\") === -1 && topic_time[key].search(\"天前\")){\n msg.payload.push(`${topic_author[key]}在${topic_time[key]},发布了${topic_name[key]}`);\n }\n}\nreturn msg;","outputs":1,"noerr":0,"x":910,"y":1640,"wires":"4e323745.f0d7c8"]]},{"id":"4e323745.f0d7c8","type":"debug","z":"ea32e082.f03d4","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":1110,"y":1680,"wires":]},{"id":"e2627606.988938","type":"delay","z":"ea32e082.f03d4","name":"","pauseType":"delay","timeout":"35","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":680,"y":1640,"wires":"772f5d1a.601354"]]}]