BBC Weather To Twitter

This flow gets weather data from the BBC every two hours and outputs it to twitter. The current setup will return a 3 day forecast but only output the current day and tomorrows weather (this can easily be changed within the function node).

Sample output: Friday: Light Cloud, Minimum Temperature: 2°C (36°F) @ Fri Jan 10 2014 21:00:00 GMT+0000 (UTC)

[{"id":"e502bb79.1afd48","type":"inject","name":"Every 2 hours .. ish","topic":"","payload":"","repeat":"","crontab":"*/120 6-21 * * *","once":false,"x":130,"y":95,"z":"3b4ff23b.c4b00e","wires":[["85e6db0e.7a1928"]]},{"id":"a44c3d45.5bb3c","type":"xml2js","useEyes":false,"name":"","x":387,"y":63,"z":"3b4ff23b.c4b00e","wires":[["935e7f68.6ca18","7082ea2b.8f7d14"]]},{"id":"85e6db0e.7a1928","type":"http request","name":"","method":"GET","url":"http://open.live.bbc.co.uk/weather/feeds/en/NE16/3dayforecast.rss","x":271,"y":151,"z":"3b4ff23b.c4b00e","wires":[["a44c3d45.5bb3c"]]},{"id":"935e7f68.6ca18","type":"function","name":"","func":"// The received message is stored in 'msg'\n// It will have at least a 'payload' property:\n//   console.log(msg.payload);\n// The 'context' object is available to store state\n// between invocations of the function\n//   context = {};\nvar now = Date();\nmsg.payload = msg.payload.rss.channel[0].item[0].title[0] + \" @ \" + now;\n//console.log(msg.payload);\nreturn msg;","outputs":"1","x":537.0000305175781,"y":37,"z":"3b4ff23b.c4b00e","wires":[["8f02653d.70fd98"]]},{"id":"7082ea2b.8f7d14","type":"function","name":"","func":"// The received message is stored in 'msg'\n// It will have at least a 'payload' property:\n//   console.log(msg.payload);\n// The 'context' object is available to store state\n// between invocations of the function\n//   context = {};\nvar now = Date();\nmsg.payload = msg.payload.rss.channel[0].item[1].title[0] + \" @ \" + now;\nreturn msg;","outputs":1,"x":534,"y":81,"z":"3b4ff23b.c4b00e","wires":[["691af354.96e50c"]]},{"id":"691af354.96e50c","type":"delay","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"minutes","rate":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","x":662,"y":201,"z":"3b4ff23b.c4b00e","wires":[["8f02653d.70fd98"]]},{"id":"8f02653d.70fd98","type":"twitter out","twitter":"","name":"Tweet","x":784,"y":134,"z":"3b4ff23b.c4b00e","wires":[]}]
christoface

Flow Info

created 3 years, 5 months ago

Node Types

Core
  • delay (x1)
  • function (x2)
  • http request (x1)
  • inject (x1)
  • twitter out (x1)
Other
  • xml2js (x1)

Tags

  • weather
  • twitter
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option