Receive notifications daily about an incoming deadline.
- Modified from https://github.com/esplorio/slack-countdown to allow countdown of weekdays to date instead of total days.
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 -w=True, --weekdays=True Count down using weekdays instead of all days
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”.countdown deadline -d 2015-07-18 -e weekend -w=True
will print out “2 weekdays 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.