Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
#!/usr/bin/env ruby
# Speedtest cli to wrapper
# based on
# More: (german)
# Original:
require 'json'
secret_key = "XXXXXXXXXXX"
speedtest = `/usr/local/bin/speedtest-cli --share`
upload = speedtest.scan(/Upload: ([0-9\.]{3,5})/)[0][0]
download = speedtest.scan(/Download: ([0-9\.]{3,5})/)[0][0]
ping = speedtest.scan(/]: ([0-9\.]{3,6})/)[0][0]
share = speedtest.scan(/Share results: (.*)/)[0][0]
json = {value1: ping, value2: download, value3: upload}
`curl -X POST -H \"Content-Type: application/json\" \
-d \"#{JSON[json].to_s.gsub("\"","\\\"")}\" \{secret_key} > /dev/null`"/tmp/speedtest.log", "a") { |file| file.puts("#{}\
- Ping: #{ping}\
- Download: #{download}\
- Upload: #{upload}\
- Share: #{share}") }
Copy link

PalminX commented May 27, 2020

Danke für das Script! Die Anleitung auf Deiner Seite funktioniert im Prinzip. Ich habe das IFTTT-Rezept noch ein wenig angepasst: wenn man für das Google Sheet als Formatted row das hier eingibt, dann bekommt man eine echte Zeitachse im Graphen:

=TIMEVALUE(SUBSTITUTE("{{OccurredAt}}"," at ", " ")) + DATEVALUE(SUBSTITUTE("{{OccurredAt}}"," at ", " ")) ||| {{Value1}} |||{{Value2}} ||| {{Value3}}

Der Tipp kommt von

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