You can use this bot to track availability of a website (or keep Heroku from sleeping 😜).
The bot polls your favourite website at regular intervals to check the HTTP Status Code. Any change on the status code, for e.g.: 200 -> 500 or 502 -> 404, would be reported to you on your Telegram.
Try it now on: https://t.me/ManDownBot
The bot lives in a Google Compute VM, and the state is stored on Google Firestore.
Infra Code is in here.
I have been running this bot for more than five years now. The cost is completely covered by Google Free Tier, so it can continue to stay available.
For any kind of uptime guarantees it is best to host it on your cloud account.
Add your Telegram bot token to the .env file and then
cargo run .cargo build --release- You send a message
/track google.in - The app checks for errors in the URL string
- If it is a fine URL then it looks up the HTTP status. It checks both
httpandhttps. - If it does not already exist in the tracked list it adds to the list
- The polling mechanism triggers the app at regular intervals. The FREQ variable in the .env file is the frequency in number of seconds.
- The app checks if the status of the website has changed.
- If the status has changed it sends a message to you.
- You send a message
/untrack google.in - The app checks for errors in the URL string
- The app deletes both
httpandhttpsforms.
- You send a message
/list - The app replies with all the domains you are currently tracking with their status codes
I will be glad if you have suggestions on improvements or bug reports, please make issues out of them. I will be happier if you would contribute code.
- Fork it
- Clone develop:
git clone -b develop https://github.com/Donnie/ManDown - Create your feature branch:
git checkout -b new-feature - Make changes and add them:
git add . - Commit:
git commit -m "Add some feature" - Push:
git push origin new-feature - Pull request
- Once your PR is submitted, the CI would automatically do some basic
cargochecks. - It would run all the tests
- Once the PR is approved and merged, pushing a new tag will trigger the build and release.
Feel free to raise issues when you have questions or you are stuck somewhere.