Skip to content

Instantly share code, notes, and snippets.

@ellisvalentiner
Created November 8, 2017 03:04
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 ellisvalentiner/f4b5bcbb1ecd4339856428fe16d6ff65 to your computer and use it in GitHub Desktop.
Save ellisvalentiner/f4b5bcbb1ecd4339856428fe16d6ff65 to your computer and use it in GitHub Desktop.
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