Skip to content

Run a speedtest and tweet results and save as a CSV file

License

Notifications You must be signed in to change notification settings

peetucket/speedtest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

# Speedtest

Tweet and log your internet speed each time this ruby script is run.

If you want to run on a schedule, setup a simple cron job that runs the ruby script.
Note that if you set this up as a cron job, you'll of course need to leave your laptop running.

# Setup

Note: I am running on a Macbook, you may need to modify some of this (particularly the speedtest cli install)
depending on your OS/hardware.

1. Use ruby 2.3 or better.  The ruby that comes pre-installed with Mac OS is probably not good enough.
See https://www.ruby-lang.org/en/documentation/installation/ for more info

2. Install the twitter gem
See https://github.com/sferik/twitter

gem install twitter

3. Install the speedtest-cli
See https://www.speedtest.net/apps/cli

On a mac, you can use homebrew:

brew tap teamookla/speedtest
brew update
brew install speedtest --force

4. Setup a Twitter application, you will need a twitter account and a twitter developer account.
Note that your app needs to have write authorization.  Your tokens will be configured in the config.yml file.
See https://apps.twitter.com/

5. Copy the example config.yml file, and edit as needed to put in your twitter credentials and other config

cp config.yml.example config.yml

6. Run on the terminal

ruby speedtest.rb

# Cron Job

An example cron job running every hour at 1 minute after the hour is shown below.  Output will be sent to cron.log.

1 * * * * /bin/bash -l -c 'cd /path/to/the/script && ruby speedtest.rb --silent >> cron.log'

About

Run a speedtest and tweet results and save as a CSV file

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages