This repository has been archived by the owner on Apr 4, 2018. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add README and contributing guidelines
- Loading branch information
Showing
3 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
config.rb |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Pull requests are great. | ||
|
||
I'm aware there are no tests for this code, but if you're submitting | ||
changes please supply some. |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Need-O-Tron Daily | ||
|
||
A script to send a daily email about the previous day's traffic to GOV.UK. | ||
This used to be part of need-o-tron but didn't really need to be included | ||
there, so I've pulled it out on its own. | ||
|
||
## Usage | ||
|
||
Use ```bundle install``` to install dependencies. | ||
|
||
Run the script with ```bundle exec ruby send_email.rb``` | ||
|
||
The script depends on a set of environment variables: | ||
|
||
* ENV['GOOGLE_OAUTH_TOKEN'] # The OAuth token to access Google Analytics | ||
* ENV['GOOGLE_OAUTH_SECRET'] # The OAuth secret to access Google Analytics | ||
* ENV['ANALYTICS_ACCOUNT_ID'] # The Google Analytics account ID | ||
* ENV['SES_ACCESS_KEY_ID'] # Access Key ID for Amazon SES (for outbound email) | ||
* ENV['SES_SECRET_KEY'] # Access Secret for Amazon SES (for outbound email) | ||
* ENV['RECIPIENT_ADDRESS'] # Email address to send the report to | ||
|
||
The recipient address will have to have been authorised via Amazon SES. | ||
|
||
To run locally you can create a file called config.rb to set these values. Don't | ||
commit it to this repository. | ||
|
||
## Credits | ||
|
||
The original need-o-tron daily was created by [Richard Pope](https://github.com/memespring) and [James Stewart](https://github.com/jystewart) some time ago. |