Skip to content

Instantly share code, notes, and snippets.

@natcl

natcl/README.md Secret

Created February 16, 2015 01:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save natcl/d8aef77a854d0de0a675 to your computer and use it in GitHub Desktop.
Save natcl/d8aef77a854d0de0a675 to your computer and use it in GitHub Desktop.
Get your monthly bandwidth usage with TekSavvy ISP

This flow will get your monthly data usage for your TekSavvy account. You need to send your API key as the payload.

[{"id":"63afb891.9c5048","type":"subflow","name":"TekSavvy","in":[{"x":39,"y":80,"wires":[{"id":"ba1fae47.45e05"}]}],"out":[{"x":745,"y":80,"wires":[{"id":"3cc7d035.c3383","port":0}]}]},{"id":"4678e5bf.b9871c","type":"http request","name":"","method":"GET","url":"https://api.teksavvy.com/web/Usage/UsageSummaryRecords?$filter=IsCurrent%20eq%20true","x":311,"y":80,"z":"63afb891.9c5048","wires":[["9b7d2312.6482e"]]},{"id":"ba1fae47.45e05","type":"function","name":"Auth","func":"api_key = msg.payload;\n\nmsg.headers = {\"TekSavvy-APIKey\": api_key}\nreturn msg;","outputs":1,"x":158,"y":80,"z":"63afb891.9c5048","wires":[["4678e5bf.b9871c"]]},{"id":"3cc7d035.c3383","type":"function","name":"Get download","func":"msg.payload = msg.payload.value[0].OnPeakDownload;\n\nreturn msg;","outputs":1,"x":612.0000076293945,"y":79.50000286102295,"z":"63afb891.9c5048","wires":[[]]},{"id":"9b7d2312.6482e","type":"json","name":"","x":462,"y":80,"z":"63afb891.9c5048","wires":[["3cc7d035.c3383"]]},{"id":"53561dea.aca9e4","type":"debug","name":"","active":true,"console":"false","complete":"false","x":588,"y":60,"z":"56f57709.a90a88","wires":[]},{"id":"be227bbc.41dd88","type":"subflow:63afb891.9c5048","x":375,"y":60,"z":"56f57709.a90a88","wires":[["53561dea.aca9e4"]]},{"id":"bff32023.400ce","type":"inject","name":"","topic":"","payload":"YOUR_API_KEY_HERE","payloadType":"string","repeat":"","crontab":"","once":false,"x":161.5,"y":60,"z":"56f57709.a90a88","wires":[["be227bbc.41dd88"]]}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment