Telegram bot for doing wikipedia graph searches for the shortest paths between articles. Uses the files created with wikipedia-graph.
The project is built using functional Scala with fs2, cats and doobie.
Requirements to run:
Scala 2.12.3+sbt 0.13.16sqlite3
To run the bot you will need to get the files index.db and graph.bin created by
wikipedia-graph. Then you will need to set up a
Telegram bot, instructions can be found here.
Next set up webhooks for your bot and
create src/main/resources/application.conf using src/main/resources/application.conf.sample
and add your bot's id and the path to the data files to it.
To start the bot locally simply run sbt run. For deployment you can create a executable
jar requiring only Java using sbt assembly.
Now your bot should be up and running and able to respond to questions of the form
/search [Star Trek: The Next Generation] [Planar ternary ring] resulting in:
Shortest path: star trek: the next generation -> ntsc -> cie 1931 color space -> projective plane -> planar ternary ring
The files created with wikipedia-graph contain around 10 million pages. A search between two articles resulting in a path of length 8 takes around 15s on my i5 laptop taking a bit over 1GB ram.