An opiniated Slack bot written for SRMSE's slack channel
- What does it do
- App structuring
- Installation
- Bot not responding
- Contributing
- License
- [Donation)(#license)
Margo will notify in realtime if the queried website is down or not. As it resides inside SRMSE's slack channel, check out whether our own web server is up or not! But yes you can query for other domains too
All the TOKENS
have been kept inside a single settings.ini.example
file.
$ tree
.
├── assets
│ └── demo.gif
├── CONTRIBUTING.rst
├── LICENSE
├── Makefile
├── margo
│ ├── constants.py
│ ├── core.py
│ ├── helpers.py
│ ├── __init__.py
│ └── utils.py
├── Procfile
├── README.md
├── requirements.txt
├── run.py
├── scripts
│ ├── __init__.py
│ └── print_bot_id.py
└── settings.ini.example
Install the dependencies
$ virtualenv margo # Create virtual environment
$ source margo/bin/activate # Change default python to virtual one
(margo)$ git clone https://github.com/prodicus/margo.git
(margo)$ cd margo
(margo)$ make deps
Deploying to Heroku
Go to the Bot users page and create a new bot to get the SLACK_BOT_TOKEN
$ # create the heroku project
$ heroku create {project-name}
$ heroku config:set BASE_URL=https://isitup.org/
$ heroku config:set RESULT_FORMAT=json
$ heroku config:set SLACK_BOT_TOKEN=YOUR-SLACK-TOKEN
$ heroku config:set BOT_ID=YOUR-BOT-ID
$ # deploy it
$ git push -u heroku master
Check the logs for any errors by doing a $ heroku logs -t
Run the script print_bot_id.py
placed in inside the project directory scripts
. Before running it, Change the the variable BOT_NAME
to the bot name you chose for your case
$ make bot_id
And then place put it inside the settings.ini
or the heroku environment (whatever you chose)
Setting up the environment variables
(margo)$ cp settings.ini.example settings.ini
and add the required values like SLACK_BOT_TOKEN
and BOT_ID
(margo)$ make run
Open you slack channel and start talking to your bot
So the thing with heroku and it's basic plan is that, the dyno sleeps after some inactivity. Visit http://margo-slackbot.herokuapp.com/ to wake up the bot!
Refer CONTRIBUTING.rst for details
- Make
margo
query a website in intervals and notify when it goes down!
Built with ♥ and vim by Tasdik Rahman (@tasdikrahman)
Open sourced under GPLv3
You can find a copy of the License at LICENSE
If you have found my little bits of software being of any use to you, do consider helping me pay my internet bills :)
PayPal | |
---|---|
Gratipay | |
Patreon | |
£ (GBP) | |
€ Euros | |
₹ (INR) |