Giter Site home page Giter Site logo

slack-countdown's Introduction

Countdown program to Slack hook

Background

Receive notifications daily about an incoming deadline.

Setup

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

  1. 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.

  2. Press this button to create a new Heroku app:

    Deploy
  3. When prompted by Heroku, paste the unique URL into the SLACK_URL field under Config variables and deploy the app.

  4. After deployment, click on "manage apps". You should also get a message to your Slack channel to confirm connection.

  5. Click on the Heroku Scheduler, this will open up a dashboard where we can run scripts periodically.

  6. 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.

  7. In the terminal type:

    python countdown.py deadline
    

    followed by your desired arguments.

  8. 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.

  9. Once this is saved the app is complete.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.