Now, if you had to manually run the script to get a measurement, that would defeat the whole purpose, so the last step is to add a cron job so the script is run automatically: $ crontab -e Zapier will execute the operation you specified (add a row to a Google Spreadsheet in my example). Go ahead and test your setup, then save your Zap once you are happy with the results. I chose to have each event add a new line to a Google Spreadsheet: Setting up Zapier to add rows to a Google Spreadsheet. Then you can decide what to do with that data. You should see something like this: Testing the Zapier Webhook to ensure the JSON data was properly received. Go ahead and click on the “view your hook” link to check what data was sent to Zapier. After a short while, Zapier should display a nice green message saying the test was successful. Go back to your browser and click the blue “OK, I did this” button. If nothing else shows up on your Terminal it’s a good sign. Copy that URL to the clipboard.Īnd wait again for the prompt to reappear. Zapier will issue a custom webhook URL to trigger your events. Leave the next screen (options) empty and click Next until you reach a screen that should look like this: Setting up a Webhook on Zapier. Using the search box, choose “Webhooks by Zapier” as your trigger, then select the “Catch Hook” option. Then click the bright red “Make a Zap” button to get started. If you haven’t got an account yet, go ahead and create one (the free plan should work just fine). It is now time to setup Zapier to receive your data. If you see output similar to the above, things are working. (Toronto, ON) 8.53 km 17.794 ms 23.97 Mbit/s 1.95 Mbit/s ĭepending on the speed of your Internet connection, it should take about a minute to run the test. 02:33:38 UTC 02:34:19 UTC Start Communications .XXX SoftLayer Technologies, Inc. Then you can try running my script in CSV mode to make sure everything is working properly: $. Once you have downloaded my repository, navigate to the bin folder 1 that’s inside it: $ cd speedtest-cli-extras Then download my code, either as a ZIP archive or by using git: $ git clone Assuming you’ve got a working install of Python, you can use your favourite package manager to get hold of speedtest-cli: $ pip install speedtest-cli My script makes use of speedtest-cli, which in turn is written in Python. How to automatically send speedtest results to Zapierįirst, take care of dependencies. Here, I will concentrate on how to use it to post to Zapier. My modified command-line interface to is available on GitHub, where I’ve also posted a few usage examples. Posts the result as a JSON document to any URL passed as argument (required) Takes a Loggly Customer Token as argument (required) Takes an IFTTT Maker Channel secret key as argument (required) h: Print CSV header (only if used together with the -c flag) d: debugging-mode (reuses previously logged speedtest result instead of queriying speedtest - faster) But of course I wasn’t satisfied with hashing together a bunch of perl one-liners, so instead I found this script to manipulate speedtest-cli output, and modified it so it could log results to a CSV file, post them to IFTTT, Loggly or to any URL that would accept JSON, such as Zapier. I liked this post describing how to use the same speedtest-cli with Loggly instead of IFTTT. I’m not a particular fan of IFTTT, which I find too linear and limiting (not to mention a certain arrogance towards third-party content providers) and thus I looked for alternative ways to post my speedtest results to an online place where I could obsessively check them whenever I’m out of the house. This weekend, inspired by this Make: Magazine feature, I hooked up a Raspberry Pi to my broadband router, set it up to periodically query (using speedtest-cli) and log the results. I realized they were difficult to diagnose both by me and my service provider (who, by the way, was very helpful) because it was difficult to determine when exactly they occurred and whether the issue was with the broadband connection or my wireless router. Recently I got frustrated by a series of broadband service failures.
0 Comments
Leave a Reply. |