Skip to content

Telegram bot for searching for the shortest paths between wikipedia articles using wikipedia-graph

Notifications You must be signed in to change notification settings

jhnj/wiki-search-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wiki search bot

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.

Usage

Requirements to run:

  • Scala 2.12.3 + sbt 0.13.16
  • sqlite3

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

Performance

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.

About

Telegram bot for searching for the shortest paths between wikipedia articles using wikipedia-graph

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages