Skip to content

Instantly share code, notes, and snippets.

@ImTheDeveloper
Created January 10, 2014 21:09
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ImTheDeveloper/7fc83efa0dbd6f440881 to your computer and use it in GitHub Desktop.
Save ImTheDeveloper/7fc83efa0dbd6f440881 to your computer and use it in GitHub Desktop.
Tweet your location with MQTTitude
[{"id":"a7c99df.f58366","type":"mqtt-broker","broker":"localhost","port":"1883","clientid":""},{"id":"a2a215e0.5d5de8","type":"mqtt in","name":"Chris","topic":"/mqttitude/chris","broker":"a7c99df.f58366","x":98,"y":157,"z":"1f737a7f.e08c86","wires":[["6c3e5363.93c1ac"]]},{"id":"d6d051c.f292fb","type":"debug","name":"","active":true,"complete":false,"x":540,"y":140,"z":"1f737a7f.e08c86","wires":[]},{"id":"6c3e5363.93c1ac","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 = JSON.parse(msg.payload);\nvar url = \"Chris is located at https://maps.google.com/?q=\" + msg.payload.lat + \",\" + msg.payload.lon + \" @ \" + now;\nmsg.payload = url;\n\nreturn msg;","outputs":1,"x":301,"y":161,"z":"1f737a7f.e08c86","wires":[["d6d051c.f292fb","49d647e9.b629b8"]]},{"id":"49d647e9.b629b8","type":"twitter out","twitter":"","name":"Tweet","x":559,"y":191,"z":"1f737a7f.e08c86","wires":[]}]
@andypiper
Copy link

MQTTitude -> OwnTracks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment