Created
November 8, 2017 03:04
-
-
Save ellisvalentiner/f4b5bcbb1ecd4339856428fe16d6ff65 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Distributions | |
using Requests | |
function main() | |
while true | |
result = speedtest() | |
out = """$(result["timestamp"]),$(result["serverinfo"]["city"]),$(result["serverinfo"]["ip"][1]),$(result["serverinfo"]["fqdn"]),$(result["serverinfo"]["site"]),$(result["upload"]),$(result["download"])\n"""; | |
f = open("/home/pi/speedresults.csv", "a") | |
write(f, out) | |
close(f) | |
s = rand(Poisson(10))*60 + 60. | |
println("Sleeping for $s...") | |
sleep(s) | |
end | |
end | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment