5 ms·
There are also a huge number of audiobooks available on YouTube. I made a Reddit bot [0] that continually scans comments across the entire site for mentions of
by reedwolf 6y ago
There are also a huge number of audiobooks available on YouTube.
I made a Reddit bot [0] that continually scans comments across the entire site for mentions of science fiction and fantasy book titles. It uses a dataset of book title/author pairs that were scraped from the Speculative Fiction Database, a compendium of all known science fiction/fantasy literary works.
If an SFF book title/author pair is detected in a comment, the bot searches YouTube for an audiobook of the mentioned title, then replies with a link to it should one be found.
[0] https://www.reddit.com/user/EmotionalField https://www.reddit.com/user/EmotionalField
- lopis 6y agoThat is seriously amazing. Thanks for sharing!
- kilroy123 6y agoGood bot
- chooseaname 6y agoWoah! This is great! Thanks so much.
- seesawtron 6y agoCool stuff. Is this open sourced so one can modify it to search for specfic genres of books or specific authors? Cheer!
- reedwolf 6y agoSure. The code's up on my site [0]. Please note that I'm a beginner programmer, so the code probably looks really ugly to professional devs. I plan on refactoring the code once I get more advanced in programming. [0] https://capybasilisk.com/posts/2020/04/speculative-fiction-bot/ https://capybasilisk.com/posts/2020/04/speculative-fiction-b...
- seesawtron 6y agoAwesome. Didn't know about reddit API wrapper praw! Thanks a ton, will give it a try. One question: How does the locally run python script feedback the scraped data to bot user account app?
- reedwolf 6y agoThe bot's currently running on a virtual private server. The scraped data is all in a CSV file located in the same directory as the bot's source file. When the bot is run, it logs on to Reddit, loads the CSV data file into memory, and begins iterating through the Reddit comment stream checking for book title/author pairs.
- Breza 6y agoDon't hate on your code. If it runs and does what you want, then it's good code. Refactoring later can be useful and improve things like performance and readability but what matters is that it works.
- reedwolf 6y agoThank you! It was the first time posting my code here, so I was kinda nervous, haha.