Example use case: you use the same bike docking stations every day to and from work; by deploying this app on Heroku you can set up (free) scheduled daily notifications on Slack with the number of bikes and spaces available at those specific docking stations.
Simple Ruby app.
Join Slack (on their free plan) if you haven't already.
You can set up a new team just for yourself to receive notifications such as this app provides.
Setup a Slack webhook where the notifications will be sent to.
.env file by copying the
example.env and amend the environment variables in it:
SLACK_WEBHOOK_URL=put_your_slack_webhook_url_here BIKEPOINT_API_URL=https://api.tfl.gov.uk/bikepoint BIKEPOINT_COMMON_NAMES=Abbey Orchard Street, Westminster;Abbotsbury Road, Holland Park
SLACK_WEBHOOK_URLuse the URL provided by the Slack webhook you set up in the "Getting Started" section above.
BIKEPOINT_COMMON_NAMES- You can keep the defaults to get up and running initially. Then you can replace the defaults provided with a semi-colon separated list of the docking station names that you would like to be notified about. (The last entry in the list does not need a semi-colon after it but will work fine either way.)
This should send a notification to Slack.
Deploying to Heroku
heroku create --region eu heroku config:set SLACK_WEBHOOK=put_your_slack_webhook_url_here heroku config:set BIKEPOINT_API_URL=https://api.tfl.gov.uk/bikepoint heroku config:set BIKEPOINT_COMMON_NAMES=put_the_names_from_your_.env_file_here git push heroku master
Alternatively, you can deploy your own copy of the app using the web-based flow:
More information about Ruby on Heroku:
Run the tests locally
rspec from the project's root folder