Skip to content

Bot that checks the availability for talks for the SNiC MobilIT event

Notifications You must be signed in to change notification settings

keesblok/SNiC-MobilIT-availability-checker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SNiC MobilIT availability checker

Environment variables

  • TELEGRAM_BOT_TOKEN: The token you got from the BotFather.
  • TELEGRAM_CHAT_ID: Your chat ID with the bot. If you send /id to the bot, it will respond with your chat ID.
  • INTERESTING_TRACKS: A comma seperated list with the tracks you are interested in. For example ns,anwb.

Heroku

To run this code on one of the Heroku servers, we listen on a specific port, so it will act like a webserver. However with the free approach on Heroku, your app will go offline if it isn't accessed within an hour. Therefore kaffeine is used to keep this app online.

Telegram bot

Automatic update

The backend checks every minute if there is an empty spot at one of the talks where you are interested in.
If it has found such a spot, it sends you a message via a Telegram bot. For example:

There is 1 place left for the talk: ns

Manual update

If you send /update to the Telegram bot, it will first respond with Running... to indicate that it's checking for empty spots. If it has found empty spots for the talks where you are interested in, it will send a new message, for example:

There are 2 places left for the talk: ns
There is 1 place left for the talk: anwb

It will always finish with a message Done to indicate it finished your request.

Get info about all talks

If you send /info to the Telegram bot, it will first respond with Running... to indicate that it's checking all spots for all talks. Then it will send a new message with the number of occupied spots for every talk, for example:

cofano: 103 of 230 places are gone.
computest: 230 of 230 places are gone.
xomnia: 82 of 230 places are gone.
han: 228 of 230 places are gone.
speeddates1: 7 of 8 places are gone.
projectmarch: 225 of 230 places are gone.
martin: 122 of 230 places are gone.
ns: 230 of 230 places are gone.
anwb: 189 of 230 places are gone.
aivd: 230 of 230 places are gone.
speeddates2: 8 of 8 places are gone.
speeddates3: 8 of 8 places are gone.

Then it will finish with a message Done to indicate it finished your request.

Online / offline

The telegram bot will also send you a message if the server starts up (I'm back online!), or shuts down (Going offline...). This message should always be sent, even if a part of the program crashed. Note that if the Telegram bot crashes, you will obviously not get a message.
By sending those messages, you will always be notified about the current status of the server. (Keep in mind that you can always access the corresponding website on Heroku to get your server back online.)

About

Bot that checks the availability for talks for the SNiC MobilIT event

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages