Get Growl Notifications following a UK Gov petition

For those of us in the UK, there are occasionally some interesting petitions that are started on the UK Government petitions website: https://petition.parliament.uk/

If you want to keep an eye on it without going to the page and clicking refresh once a day, you can easily set up a Node-Red flow to follow the number of signatures on the petition.

In this flow, I'm using the growl node to get notifications on my Ubuntu desktop, but you could quite easily substitute it for a PushBullet / Pushover / MQTT node as well!

[{"id":"7f1d4170.ba2e4","type":"inject","z":"17e6be9f.7c0251","name":"Trigger Check","topic":"","payload":"true","payloadType":"bool","repeat":"120","crontab":"","once":false,"x":168.5,"y":60,"wires":[["12bca2b4.3f6e8d"]]},{"id":"12bca2b4.3f6e8d","type":"http request","z":"17e6be9f.7c0251","name":"Get Petition JSON","method":"GET","ret":"txt","url":"https://petition.parliament.uk/petitions/126512.json","x":365.5,"y":60,"wires":[["e5d8f88d.05fef8"]]},{"id":"e5d8f88d.05fef8","type":"json","z":"17e6be9f.7c0251","name":"","x":530,"y":60,"wires":[["bb109835.b29338"]]},{"id":"d9465227.8cfcd","type":"notify","z":"17e6be9f.7c0251","title":"Petition Signatures","name":"Petition Signatures","x":907.5,"y":60,"wires":[]},{"id":"bb109835.b29338","type":"function","z":"17e6be9f.7c0251","name":"Create Message","func":"var count = msg.payload.data.attributes[\"signature_count\"];\nmsg.payload = \"There have been \" + count + \" signatures so far!\";\n\nreturn msg;","outputs":1,"noerr":0,"x":700,"y":60,"wires":[["d9465227.8cfcd"]]}]
jpwsutton

Flow Info

created 1 year, 7 months ago

Node Types

Core
  • function (x1)
  • http request (x1)
  • inject (x1)
  • json (x1)
Other

Tags

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