惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
A
About on SuperTechFans
IT之家
IT之家
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Blog — PlanetScale
Blog — PlanetScale
aimingoo的专栏
aimingoo的专栏
云风的 BLOG
云风的 BLOG
The GitHub Blog
The GitHub Blog
Vercel News
Vercel News
G
Google Developers Blog
J
Java Code Geeks
宝玉的分享
宝玉的分享
T
Tailwind CSS Blog
Cloudbric
Cloudbric
L
LINUX DO - 最新话题
MyScale Blog
MyScale Blog
H
Heimdal Security Blog
PCI Perspectives
PCI Perspectives
Attack and Defense Labs
Attack and Defense Labs
S
Security @ Cisco Blogs
Latest news
Latest news
I
Intezer
L
Lohrmann on Cybersecurity
C
CXSECURITY Database RSS Feed - CXSecurity.com
月光博客
月光博客
T
Threatpost
博客园 - 【当耐特】
S
Schneier on Security
P
Privacy International News Feed
G
GRAHAM CLULEY
T
Tenable Blog
AWS News Blog
AWS News Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
雷峰网
雷峰网
博客园 - Franky
Engineering at Meta
Engineering at Meta
美团技术团队
S
Secure Thoughts
T
Troy Hunt's Blog
Microsoft Security Blog
Microsoft Security Blog
SecWiki News
SecWiki News
V
Visual Studio Blog
人人都是产品经理
人人都是产品经理
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Cisco Talos Blog
Cisco Talos Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Martin Fowler
Martin Fowler
Webroot Blog
Webroot Blog
Google DeepMind News
Google DeepMind News
H
Hackread – Cybersecurity News, Data Breaches, AI and More

Stonecharioteer on Tech

I Traced My Traffic Through a Home Tailscale Exit Node What Was I Reading Last? In Three Not-So-Easy Pieces Dogfooding Is Hard Code blocks in your books, finally GoForGo v0.9.0 Merrilin - We built an app to read books I use a Macbook now Data Structures & Algorithms - Preparing for Interviews Using a local DNS namespace for local service discovery Direction KOllector - Publishing KOReader Highlights gbt: branches touched in the last 24 hours A Soiree into Symbols in Ruby Some Smalltalk about Ruby Loops Ruby Blocks Returning from Ruby Blocks, Procs and Lambdas My Linux Laptop Finally Works: How Claude Helped Me Fix Years of Annoyances TIL: Watchexec - Modern File Watching for Development Workflows A Less Busy Mind GoForGo - Learn Go through live examples Migrating My Old Blog to Hugo with Claude The Qtile Window Manager: A Python-Powered Tiling Experience Read the RFCs that Built the Internet Py-x-Protobuf - Or How I Learned to Stop Worrying and Love Protocol Buffers Python Reverse a List New Beginnings Leaving ChainSafe Systems Screen Lock for Cinnamon Desktop using Zenity and Terminal Commands Crews Not Teams A System for Getting Better at LeetCode So Far So Rust Retrying HTTP Requests with Rust A Primer on Control Charts Learning Rust Explicit is Better than Implicit: Rust for Pythonistas Using Custom Delimiters in Jinja Templates TIL: Creating Fixed Length Iterables in Python Documentation Without Assumption Vagrant Python - A Reflection in 2022 Learning Golang No, A Virtual Machine Is Not Enough: Why Developers Need Native Linux Empathy in Tech For Those Who Came in Late A Weekend With PostgreSQL TIL: Gooey and Python Fire for Quick GUIs and CLIs TIL: 2ality - Dr. Axel Rauschmayer's JavaScript Blog TIL: MassDNS - High-Performance Bulk DNS Lookups TIL: Matomo Analytics, Google Tech Writing, Memory Programming, and NES TV Signals TIL: MontyDB - MongoDB Implemented in Python Returning to the Craft of Programming TIL: CPUFetch, OneFetch, and Learn CSS TIL: DNS Performance Testing and Pi-hole with Unbound TIL: Eli Bendersky's Blog, Awesome By Example, NoCoDB, and Martin Kleppmann TIL: CRDTs, Extreme HTTP Performance, and BYTEPATH Game TIL: AutoInvent, ASGI, Python Packaging, RAPIDS GPU Computing, and FlaskCon TIL: MangaDesk - Terminal Client for MangaDex TIL: McFly - Smart Shell History Search TIL: Siege Load Testing and Awesome FastAPI Resources TIL: Ventoy Bootable USB and Justniffer Network Analysis TIL: CLI Code Review, Git Split Diffs, and Internal Combustion Engine TIL: Benford's Law, Web Security Headers, Event Sourcing, and Mozilla Security Guidelines How to Write Documentation - The README.md File The Importance of Documentation TIL: NNgroup UX Research, SponsorBlock, and Labella Python Library TIL: The Little Book of Rust Macros and Rust Performance Book TIL: Git-Bug Distributed Issue Tracker and Omni Kubernetes Monitoring TIL: Zellij - Modern Terminal Multiplexer TIL: How Discord Handles 2.5 Million Concurrent Voice Users TIL: Volumio - The Audiophile Music Player TIL: Areopagitica - Milton's Defense of Free Speech TIL: Fast Node Manager, Zoxide Smart CD, Technical Writing, PyO3, and Qubes OS TIL: Slurm Workload Manager for HPC Clusters TIL: Data Visualization Guide and Oso Authorization Academy TIL: CORS Deep Dive, Piku Tiny PaaS, Rust Strings, and Deno Standard Library TIL: Raspberry Pi OS Development, Vim Beginner Guide, Password Management, and QueryBook TIL: uBlock Origin Performance Optimization on Firefox TIL: Breaking PostgreSQL at Scale and LeetCode Problem Patterns TIL: Awesome Tmux Resources for Terminal Multiplexing TIL: Grit - A Multitree-Based Personal Task Manager TIL: Lens 4.2 Kubernetes IDE, Shell Scripting Guide, and Dark HTTP Server Do The Job You Hate So You Won't Hate The Job You Love TIL: Innernet VPN Solution and NoteCalc Calculator App TIL: Argo CD for GitOps and Lens Kubernetes IDE TIL: Modern Rust CLI Tools - System Monitoring, HTTP Requests, and DNS TIL: tz - A Time Zone Helper Tool TIL: Distributed Systems Education, Fallacies, and Self-Hosted Internet Archiving TIL: Real-Time Voice Cloning Technology TIL: ChartMuseum for Helm, AMD's Corporate Journey, and Kubernetes Pod Scaling TIL: Docker and Kubernetes Tools - Whaler, Descheduler, and Dive TIL: Post-Mortem Collection, Terminal Plotting, and Technical Twitter TIL: Dark Mode Toggle Web Component by Google Chrome Labs TIL: Python eval(), exec(), and compile() Functions TIL: Camelot PDF Tables, PostgreSQL Row Level Security, Zerodha Varsity, and Write Yourself a Git TIL: fuser Command for Process and File Investigation TIL: i Hate Regex - The Ultimate Regex Cheat Sheet TIL: Dolt - Git for Data and Database Version Control TIL: x86 Assembly Programming and SafeEyes Break Reminder TIL: Comprehensive Distributed Systems Reading List TIL: Cosmopolitan C Library, Distributed Systems Book, High Performance Browser Networking, and Rust Roguelike Tutorial
Sarathi - A Personal Discord Bot for TIL Management
2020-11-30 · via Stonecharioteer on Tech

Project Status - Deprecated

Sarathi has been deprecated since I migrated this blog to Hugo. My TIL workflow has evolved significantly - I now use GenAI-powered tools to create comprehensive TIL posts from my learning archive, generating detailed technical content that goes far beyond simple link collection. This post remains as documentation of an interesting automation project from my pre-Hugo days.

I’ve been maintaining a TIL (Today I Learned) page for a while now, and while the idea is great, I have had some issues updating the sheet daily. The manual workflow was becoming a bottleneck in my learning documentation process.

The Problem with Manual TIL Management

My original flow looked like this:

  1. Discovery: Whenever I find a link or factoid interesting, I save them in a WhatsApp group where I’m the only member for later record
  2. Manual Transfer: Add these to the TIL page whenever I could find time
  3. Reality: Lately, I’ve not been able to keep up with the manual updates

The problems with this approach were numerous:

Manual Process Issues

  • Too Manual: This is against everything I believe in - I automate everything I can
  • Poor Searchability: Finding links is hard unless I’m using ripgrep on a non-mobile device
  • Difficult Maintenance: Categorizing things and updating the look of my TIL page is cumbersome
  • Mobile Unfriendly: Hard to update when away from my development machine

I had been meaning to leverage a Telegram bot for this task for quite some time, but never got around to actually building it. This weekend, as I prepped myself to shift my body clock to attend David Beazley’s RAFT Course, I decided to use the midnight oil to write my own bot.

Why Discord Over Telegram?

I’ve been using Discord to talk to friends and communities lately, and I’ve found its integration with Linux to be amazing. Here’s why I chose Discord:

Platform Benefits

  • Cross-Platform: Excellent web UI, desktop app that works well everywhere
  • Mobile Support: Great mobile app for phones and tablets
  • Linux Integration: Seamless experience on my primary development platform
  • API Quality: Robust Python library with comprehensive documentation

Developer Experience

  • Rich API: Discord’s API is well-designed and feature-complete
  • Python Library: discord.py provides excellent abstractions
  • Community: Large developer community with good examples and support

Development Resources

I relied on several key resources for building Sarathi:

  1. Real Python Discord Bot Tutorial - Excellent starting point
  2. Discord Official Documentation - Comprehensive API reference
  3. discord.py Documentation - Library-specific guidance

Documentation Quality

One observation: The Discord API is robust, but the discord.py documentation leaves something to be desired. However, users of click will really understand how this library is architected - the patterns are very similar.

Bot Goals and Features

I wanted Sarathi to handle the complete TIL workflow automatically:

Core Functionality

  1. Input Processing: Parse arbitrary commands for URLs or factoids
  2. Content Extraction: Extract titles from URLs automatically
  3. Data Management: Maintain a time-based JSON file in my blog’s GitHub repository
  4. Git Integration: Automatically commit the JSON to GitHub
  5. Site Generation: Regenerate the til.md file using Jinja2 templates
  6. Auto-Deploy: Push code to GitHub for instant blog updates
  7. Search API: Query the knowledge base with simple search functionality

Smart Features

  • Duplicate Detection: Prevent adding the same TIL on the same date
  • Repetition Tracking: Track when I encounter previously recorded information
  • Category Management: Organize TILs with space-separated category tags
  • Mobile-First: Designed for easy use from Discord mobile app

Bot in Action

Let me show you how Sarathi works in practice:

Help Command

The bot uses / as a command prefix and provides comprehensive help:

/help - Show all available commands
/til add <url> <categories> - Add a URL to TIL with categories
/til add <factoid> <categories> - Add a text factoid to TIL
/til find <search-string> - Search existing TIL entries

Adding a URL

Command: /til add https://example.com/article python automation

Result: Sarathi extracts the page title, adds it to the JSON database with today’s date, commits to GitHub, regenerates the TIL page, and confirms the addition.

Duplicate Prevention

If you try adding the same TIL on the same date, Sarathi provides intelligent feedback:

Smart Duplicate Handling

  • Same Day: “You just learned this today!”
  • Different Day: Adds to repeated_added_on field for learning pattern analysis
  • Future Analysis: Could help identify gaps in my learning retention

Factoid Support

Not all TILs are links - sometimes they’re just interesting facts:

/til add "Python's GIL can be released using C extensions" python performance

Sarathi handles both URLs and plain text factoids seamlessly.

Search Functionality

Query your accumulated knowledge instantly:

/til find python regex

The search matches against:

  • Categories: Tagged topics and themes
  • Content: URL titles and factoid text
  • Context: Any metadata associated with entries

Technical Architecture

Core Technologies

  • Python: Primary development language
  • discord.py: Discord API integration
  • Beautiful Soup: Web scraping for URL title extraction
  • Jinja2: Template engine for TIL page generation
  • Git/GitHub: Version control and hosting
  • JSON: Simple, readable data storage format

Workflow Automation

  1. Discord Input → Parse command and extract data
  2. Content Processing → Fetch URL titles, validate input
  3. Database Update → Add to JSON with timestamps and categories
  4. Git Operations → Commit changes with descriptive messages
  5. Site Regeneration → Use Jinja2 templates to rebuild TIL page
  6. Deployment → Push to GitHub for instant site updates

Data Structure

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
{
  "2020-11-30": [
    {
      "type": "url",
      "url": "https://example.com/article",
      "title": "Extracted Page Title",
      "categories": ["python", "automation"],
      "added_at": "2020-11-30T10:30:00Z",
      "repeated_added_on": []
    }
  ]
}

Learning and Development Experience

Building Sarathi taught me several important lessons:

Discord Bot Development

  • Command Patterns: How to structure bot commands effectively
  • Async Programming: Working with Discord’s async/await patterns
  • Error Handling: Graceful failure and user feedback
  • State Management: Handling persistent data across bot restarts

Workflow Automation

  • Git Integration: Programmatic commits and pushes
  • Template Systems: Dynamic content generation with Jinja2
  • Web Scraping: Reliable title extraction from diverse websites
  • Data Validation: Ensuring data integrity in automated systems

Future Improvements

Several enhancements are planned for Sarathi:

Immediate Roadmap

  1. TODO Bot: Manage my TODO list with VSCode-compliant TODO files
  2. Book Bot: Interface with my bookshelf’s API for reading tracking
  3. Reading Progress: Track book reading progress and notes
  4. Anki Integration: Generate Anki cards from TIL entries for spaced repetition

Advanced Features

  • Regex Search: More powerful search with regular expression support
  • Notes Integration: Interface with my notes repository for learning packages
  • Analytics: Learning pattern analysis and knowledge gap identification
  • Export Options: Multiple output formats (PDF, Markdown, etc.)

Impact and Results

Sarathi has dramatically improved my learning documentation workflow:

Quantitative Improvements

  • Speed: From manual updates taking 10-15 minutes to instant Discord commands
  • Consistency: No more missed or forgotten TIL entries
  • Accessibility: Can update from anywhere using Discord mobile app
  • Organization: Automatic categorization and searchable knowledge base

Qualitative Benefits

  • Reduced Friction: Learning documentation is now effortless
  • Better Retention: Searchable format helps reinforce past learning
  • Pattern Recognition: Duplicate tracking reveals learning gaps
  • Motivation: Seeing accumulated knowledge encourages continued learning

Source Code and Learning

The complete source code for Sarathi is available on GitHub: stonecharioteer/sarathi

While very specific to my personal workflow, the codebase demonstrates several useful patterns:

Learning Opportunities

  • Discord bot command structure and async patterns
  • Git automation with Python subprocess calls
  • Web scraping with Beautiful Soup and requests
  • Template systems with Jinja2 for content generation
  • JSON data management for simple persistent storage

Reflection on Automation

This project reinforces a core principle I hold: automate the boring stuff. By removing the friction from learning documentation, I’ve made it more likely that I’ll actually capture and retain new knowledge.

Automation Philosophy

The best productivity systems are the ones you actually use. By making TIL documentation as easy as sending a Discord message, I’ve removed the biggest barrier to maintaining my learning journal.

Sarathi proves that sometimes the best solutions are the ones we build ourselves, tailored exactly to our personal workflows and preferences.


Building Sarathi was a weekend project that turned into a daily productivity multiplier. It demonstrates how automation can transform tedious manual processes into effortless habits, ultimately supporting better learning and knowledge retention.