IJFbot goes Open Source #ijf16
Story of a bot liberation
by Tommaso Tani
Why a bot?
I’ve developed a Telegram bot for the 10th edition of the International Journalism Festival, held from the 5th to the 10th of April 2016 in Perugia, Italy.
We opted for a bot instead of a mobile application because of the high speed in reaching the desired content that these systems can provide. Our Festival was a perfect environment to test and to begin a wider path for apps replacement.
Our bot has 4 (plus 1) commands:
- `/help`: it gives information about the bot itself
- `/now`: it gives the list of the ongoing sessions
- `/locate [location]`: it gives directions for a festival venue
- `/speaker [speaker name]`: it gives the list of sessions with this speaker
There is another command that has not been deployed yet:
- `/food`: it gives a list of restaurants close to your location
We reached 2500 requests* to the bot in the 5 days of the Festival — a good number considering that Telegram is not so popular at the moment and that this was a test project.
The most used command was `/speaker`: quite obvious indeed, because maybe this is the most useful way to look for a session in such a festival. In second place, the `/now` command, displaying all sessions that were being held at that time. This is going be an even more powerful tool thanks to the latest Telegram bot 2.0 update that will allow users to use the inline keyboard to see paged results instead of scrolling through a significant number of results — as the @music bot does.
To some extent we reached our goal; even if the website scored more page views than last year (over 170k in the week of the festival), more than 2500 hits to the bot represents a start for bots replacing (often useless) apps, at least when focused on a single event. It would be interesting to know how many people downloaded Telegram just for the IJFBot.
The bot is all written in Node.js based on the Telegram Bot Boostrap code by kengz which deals with the original Telegram bot API. I made some changes just to update the original code and add some utilities — i.e. the Markdown syntax support in replies. It runs on Heroku where the Hobbu Dyno was enough for handling our amount of traffic. After the week of the Festival, we have switched to the free basic option. All data was gathered from the IJF website or from internal JSON files, as described in the GitHub project.
I decided to make this bot available for all as open source software under the GNU General Public License, version 3 (GPL-3.0) after the festival ended. I did this in memory of Aaron Swartz.