tsoding / kgbotka

Twitch/Discord Chat Bot that works for KGB monkaS
https://twitch.tv/tsoding
MIT License
17 stars 1 forks source link

Add xkcd command to search for a particular xkcd comic #233

Closed iv4nhoe closed 4 years ago

iv4nhoe commented 4 years ago

It would be nice to have an xkcd command to which you can provide one (or several?) keywords and which would search the xkcd comics for that keyword. For example, xkcd compiling should give https://xkcd.com/303/ Or, since it appears that each comic has a transcript div tag, these transcriptions could be searched for the keyword also and xkcd -ass might yield https://xkcd.com/37/.

rexim commented 4 years ago

@iv4nhoe does xkcd have some sort of API for that?

iv4nhoe commented 4 years ago

Not exactly, but there's a json interface. https://xkcd.com/json.html

rexim commented 4 years ago

@iv4nhoe how do we do it then? Build some sort of index manually? Sounds pretty tedious :thinking:

iv4nhoe commented 4 years ago

how do we do it then? Build some sort of index manually?

I guess that's what would be needed to be done. I've searched a bit more and found there's https://relevant-xkcd.github.io to search xkcd comics. The source is on github too: https://github.com/adtac/relevant-xkcd, but it looks like they're maintaining an index of the comics too (not sure because I'm not too familiar with go).

Sounds pretty tedious thinking

Fair enough, feel free to close the issue.

rexim commented 4 years ago

@iv4nhoe looks interesting. Thanks! I'll take a look into it!