The Palos Publishing Company

Follow Us On The X Platform @PalosPublishing
Categories We Write About

Create a daily reading recommendation bot

Here’s a complete implementation of a Daily Reading Recommendation Bot using Python. This bot provides users with a daily book/article/blog recommendation based on categories like fiction, non-fiction, self-help, and more. You can expand it later to pull from APIs like Google Books or Medium.

python
import random from datetime import datetime class ReadingRecommendationBot: def __init__(self): self.recommendations = { "fiction": [ "The Midnight Library by Matt Haig", "Where the Crawdads Sing by Delia Owens", "The Night Circus by Erin Morgenstern", "Project Hail Mary by Andy Weir", "Circe by Madeline Miller" ], "non_fiction": [ "Sapiens by Yuval Noah Harari", "Educated by Tara Westover", "Atomic Habits by James Clear", "The Body Keeps the Score by Bessel van der Kolk", "Outliers by Malcolm Gladwell" ], "self_help": [ "The Subtle Art of Not Giving a F*ck by Mark Manson", "Think Like a Monk by Jay Shetty", "The Power of Now by Eckhart Tolle", "Deep Work by Cal Newport", "Can’t Hurt Me by David Goggins" ], "tech": [ "Clean Code by Robert C. Martin", "The Pragmatic Programmer by David Thomas & Andrew Hunt", "Designing Data-Intensive Applications by Martin Kleppmann", "AI Superpowers by Kai-Fu Lee", "Life 3.0 by Max Tegmark" ], "blog": [ "Farnam Street (fs.blog)", "Wait But Why by Tim Urban", "Paul Graham’s Essays (paulgraham.com)", "Stratechery by Ben Thompson", "Nautilus (nautil.us)" ] } def get_daily_recommendation(self, category=None): random.seed(datetime.now().timetuple().tm_yday) # Ensures the same rec for a day if category and category in self.recommendations: return random.choice(self.recommendations[category]) else: all_recs = [item for sublist in self.recommendations.values() for item in sublist] return random.choice(all_recs) # Example Usage bot = ReadingRecommendationBot() # Get a general daily recommendation print("📚 Today's Reading Recommendation:") print(bot.get_daily_recommendation()) # Get a category-specific recommendation print("n📘 Self-Help Pick of the Day:") print(bot.get_daily_recommendation("self_help"))

Features:

  • Daily Seeded Randomization: Ensures the same recommendation persists throughout a day.

  • Category Filtering: Optional argument to get specific genre recommendations.

  • Simple Expandability: Easily add new sources or integrate APIs.

Let me know if you want this turned into a Telegram/Discord bot or integrated with web scraping or an RSS feed.

Share this Page your favorite way: Click any app below to share.

Enter your email below to join The Palos Publishing Company Email List

We respect your email privacy

Categories We Write About