Receive notifications daily about an incoming deadline.
We built this in the run up to TC Disrupt SF 2015 to light a giant fire under our arses.
There are two ways of setting up. One is to clone this repository and make any optional modifications to the coundown.py file and deploy it yourself to Heroku. The other is to follow the simple steps below which uses the Heroku button to deploy the app.
A prerequisite is that you have a Heroku account and have added a method of payment on there. Including add ons on a Heroku app, even though the Heroku Scheduler is free, requires that the account has a method of payment.
NOTE: If you use the heroku deployment button, you wont be able to upload a picture or other modifications
-
Create a new incoming webhook for your Slack channel and copy the unique URL. This is the URL countdown.py will be sending post requests to.
-
Press this button to create a new Heroku app:
-
When prompted by Heroku, paste the unique URL into the
SLACK_URL
field underConfig variables
and deploy the app. -
After deployment, click on "manage apps". You should also get a message to your Slack channel to confirm connection.
-
Click on the Heroku Scheduler, this will open up a dashboard where we can run scripts periodically.
-
We will need run the countdown.py deadline task. The specification for the method is as follows:
The method takes two optional arguments. Options: -d DEADLINE, --deadline=DEADLINE Specify the deadline in ISO format: yyyy-mm-dd -e EVENT, --event=EVENT Name of the deadline event -b, --business-days Give the count of business days only
i.e. If the date today is the 16th July 2015 then
countdown deadline -d 2015-07-18
will print out “2 days until 18 July 2015”countdown deadline -d 2015-07-18 -e weekend
will print out “2 days until weekend”.
If no argument is given, the default is for the method to post how many days till the next Christmas.
-
In the terminal type:
python countdown.py deadline
followed by your desired arguments.
-
Next specify how often you want the script to run, i.e. how often you want a reminder of your deadline in the Slack Channel.
-
Once this is saved the app is complete.