-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
46 lines (28 loc) · 1.47 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# 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'