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

推荐订阅源

Cisco Talos Blog
Cisco Talos Blog
量子位
小众软件
小众软件
Microsoft Azure Blog
Microsoft Azure Blog
V
Visual Studio Blog
I
InfoQ
Jina AI
Jina AI
The Cloudflare Blog
Recorded Future
Recorded Future
Recent Announcements
Recent Announcements
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
G
Google Developers Blog
Stack Overflow Blog
Stack Overflow Blog
阮一峰的网络日志
阮一峰的网络日志
Microsoft Security Blog
Microsoft Security Blog
美团技术团队
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Martin Fowler
Martin Fowler
T
Tailwind CSS Blog
博客园 - Franky
酷 壳 – CoolShell
酷 壳 – CoolShell
F
Fortinet All Blogs
WordPress大学
WordPress大学
P
Proofpoint News Feed
D
DataBreaches.Net
爱范儿
爱范儿
雷峰网
雷峰网
D
Docker
B
Blog
Engineering at Meta
Engineering at Meta
腾讯CDC
N
Netflix TechBlog - Medium
C
Check Point Blog
博客园 - 【当耐特】
Apple Machine Learning Research
Apple Machine Learning Research
T
Tenable Blog
GbyAI
GbyAI
Security Archives - TechRepublic
Security Archives - TechRepublic
博客园 - 三生石上(FineUI控件)
T
The Blog of Author Tim Ferriss
博客园 - 聂微东
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
SecWiki News
SecWiki News
S
Security @ Cisco Blogs
S
Security Affairs
V
V2EX
Application and Cybersecurity Blog
Application and Cybersecurity Blog
云风的 BLOG
云风的 BLOG
C
CERT Recently Published Vulnerability Notes
Y
Y Combinator Blog

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
I run 17 RSS feeds through stdlib XML parsing every morning — here's the dedupe pipeline that keeps 600+ stories from drowning my inbox
Aman Sachan · 2026-06-15 · via DEV Community

Every morning at 6am IST, a 293-line Python script grabs seventeen RSS feeds, normalizes 600+ stories through three dedupe passes, buckets them into nine categories, and lands a clean brief in my inbox before I have coffee. No feedparser, no requests, no framework — just urllib, xml.etree, and a stack of regular expressions.

The Problem With Reading The News In India

India's news ecosystem is dense, multilingual, and aggressively cross-posted. The same press release from a state ministry lands on Google News, Times of India, NDTV, India Today, Scroll, and The Wire within an hour. The same air-strike story has six headlines that differ only in the outlet's name. If you naively concatenate 17 feeds you get a wall of dupes that hides the actually-new story underneath.

I wanted one thing: a brief that tells me what's new since yesterday, with the original publisher linked where possible, sorted by recency and category. I did not want a pip install marathon for a script that fetches XML.

So I wrote daily_brief.py in the india-daily skill — pure stdlib, runs on a Zo Computer scheduled agent, and has produced 40+ consecutive morning briefs without a single dependency conflict.

Feed Layer — 17 Sources, Zero Dependencies

The feed list is the boring foundation that determines everything else. I started with seven Google News queries (India, Politics, Economy, World, Tech, Business, Defence) because Google News is the single best indexer of regional stories in real time. Then I added ten direct publisher feeds — TOI, The Hindu, Indian Express, NDTV, Hindustan Times, Moneycontrol, Deccan Herald, BBC India, The Print, Scroll, The Wire — because Google News drops stories after a few hours and the original publisher is the only durable source for a morning brief.

FEEDS = [
    ("India", "https://news.google.com/rss/search?q=India&hl=en-IN&gl=IN&ceid=IN:en"),
    ("Politics", "https://news.google.com/rss/search?q=India+politics+election+bjp+congress&hl=en-IN&gl=IN&ceid=IN:en"),
    ("Economy", "https://news.google.com/rss/search?q=India+economy+market+stock&hl=en-IN&gl=IN&ceid=IN:en"),
    ("World", "https://news.google.com/rss/search?q=India+foreign+diplomacy&hl=en-IN&gl=IN&ceid=IN:en"),
    ("Tech", "https://news.google.com/rss/search?q=India+technology+ai+startup&hl=en-IN&gl=IN&ceid=IN:en"),
    ("Business", "https://news.google.com/rss/search?q=India+business+corporate&hl=en-IN&gl=IN&ceid=IN:en"),
    ("TOI", "https://timesofindia.indiatimes.com/rssfeeds/1898055.cms"),
    ("Hindustan Times", "https://www.hindustantimes.com/rss/top-news/rssfeed.xml"),
    ("The Hindu", "https://www.thehindu.com/news/national/rss.xml"),
    ("Indian Express", "https://indianexpress.com/rss/section/india/"),
    ("NDTV", "https://ndtvnews-india-edition.rss"),
    ("Moneycontrol", "https://www.moneycontrol.com/rss/latestnews.xml"),
    ("Deccan Herald", "https://www.deccanherald.com/rssfeed/front-page-topstories"),
    ("BBC India", "https://feeds.bbci.co.uk/news/world/asia/india/rss.xml"),
    ("The Print", "https://theprint.in/feed/"),
    ("Scroll.in", "https://rss.scroll.in"),
    ("The Wire", "https://thewire.in/rss"),
]

Seventeen feeds. Not 600+. The 600+ number you saw in my last post is the raw story count after dedupe — 17 feeds feeding into a wide funnel of Google News queries pulls in 50-80 fresh stories per source before I collapse them.

The parser handles both RSS 2.0 (<item>) and Atom (<entry>) in one loop:

def parse_feed(name, url):
    ctx = ssl.create_default_context()
    ctx.check_hostname = False
    ctx.verify_mode = ssl.CERT_NONE
    try:
        req = urllib.request.Request(url, headers={'User-Agent': 'Mozilla/5.0'})
        with urllib.request.urlopen(req, timeout=8, context=ctx) as r:
            raw = r.read().decode('utf-8', errors='ignore')
        root = ET.fromstring(raw)
        items = root.findall('.//item') or root.findall('.//entry')
        ...

Each feed is fetched in series with an 8-second timeout. A single feed going down — Scroll.in was down for 36 hours last month — never breaks the brief. The script logs ❌ Scroll.in: failed and moves on. By the time I'm reading the brief, the brief has already been emailed.

The Three Dedupe Passes

This is the part that took the most iteration. A naive title-equality check collapses maybe 30% of dupes. The actual story count goes from 600 to ~50 only after three distinct passes.

Pass 1 — Google News URL Unwrap

Google News wraps every story in a redirect URL like:

https://news.google.com/articles/CBMiXWh0dHBzOi8vd3d3LnRoZWhpbmR1LmNvbS9pbmRpYS9uYXRpb25hbC8...

That CBMi... token is the canonical article ID. Before doing any title work, I unwrap to the real publisher URL using urllib.parse.unquote on the url= parameter, and if the URL is too long to be clickable I truncate to the article ID:

def clean_url(url):
    url = url.strip()
    if 'news.google.com' in url:
        m = re.search(r'url=([^&\s]+)', url)
        if m:
            try:
                from urllib.parse import unquote
                url = unquote(m.group(1))
            except:
                pass
    if 'news.google.com' in url and len(url) > 120:
        m = re.search(r'CBM[ij][a-zA-Z0-9_-]+', url)
        if m:
            url = 'https://news.google.com/articles/' + m.group(0)
    return url[:300]

This single function takes the brief from "wall of identical 400-character Google URLs" to "clickable publisher links."

Pass 2 — Title Normalization

After URL unwrap, every story is keyed by a normalized title — punctuation stripped, lowercased, first 150 chars only:

def title_norm(t):
    t = t.lower()
    t = re.sub(r'[^\w\s]', ' ', t)
    t = re.sub(r'\s+', ' ', t).strip()
    return t[:150]

This collapses "PM Modi inaugurates Bharat Innovates 2026 in Nice" and "Modi inaugurates Bharat Innovates 2026 in Nice, France" into the same bucket. I keep the highest-quality version of the story, ranked by a url_score() function that prefers non-Google URLs (+10), quality publishers (+5), and shorter canonical URLs.

Pass 3 — Semantic Keyword Overlap

Pass 2 misses stories that use genuinely different headlines but cover the same event. "Three Indian sailors killed in US strikes on oil tankers in Gulf" and "India issues strong protest after second attack on ship off Oman" are not the same after normalization, but they overlap heavily on keywords.

I compute a Jaccard similarity on the keyword sets (with a stopword filter of 38 common words) and merge anything above 0.6:

def text_similarity(s1, s2):
    kw1 = get_keywords(s1)
    kw2 = get_keywords(s2)
    if not kw1 or not kw2:
        return 0
    inter = len(kw1 & kw2)
    union = len(kw1 | kw2)
    return inter / union if union > 0 else 0

The 0.6 threshold was tuned against a 30-day sample. Below 0.5, you start merging unrelated stories ("Modi in France" with "Modi launches scheme"). Above 0.7, the briefs get bloated with near-duplicates again.

Categorization — Keyword Bucketing Into 9 Bins

Once dedupe lands, every story is bucketed into one of nine categories by walking a keyword trie:

cat_kw = {
    'POLITICS': ['election','vote','bjp','congress','modi','rahul','parliament','minister','cabinet',
                 'campaign','party','assembly','lok sabha','govt','government','law','bill','court',
                 'arrest','kejriwal','aap','trinamool','nda','upa'],
    'ECONOMY': ['economy','gdp','market','stock','sensex','nifty','rupee','inflation','rbi','bank',
                'loan','investment','fdi','budget','tax','gst','export','trade','currency','finance','ipo','shares'],
    'WORLD': ['china','pakistan','usa','iran','russia','ukraine','diplomacy','embassy','un ',
              'global','foreign','summit','bilateral','treaty','border','trump'],
    'BUSINESS': ['company','corporate','tata','reliance','infosys','tcs','wipro','startup','merger',
                 'acquisition','deal','revenue','profit','quarter','results','launch','product','ipo'],
    'TECH': ['ai ','tech','google','meta','apple','microsoft','startup','software','app','digital',
             'cyber','data','online','semiconductor','chip','indiaai','artificial intelligence','chatgpt','robot'],
    'DEFENCE': ['defence','military','army','navy','air force','iaf','border','ladakh','weapon',
                'missile','drone','soldier','security','terror','attack','pahalgam'],
    'SPORTS': ['cricket','ipl','football','hockey','tennis','olympics','world cup','match','score',
               'player','team','tournament','bcci'],
    'SCIENCE': ['space','isro','nasa','satellite','research','health','vaccine','disease','doctor',
                'hospital','treatment'],
}

Order matters. A story that says "Tata launches new AI semiconductor plant" gets bucketed as BUSINESS, not TECH, because BUSINESS is checked first. The order reflects how Indian readers actually segment news — a corporate event is a corporate event, even if the underlying tech is interesting.

Output — Plain Text, No HTML Email Surprises

The final report is a plain text block with a fixed-width rule, category headers, and one story per block:

========================================================================
  🇮🇳 INDIA DAILY BRIEF — Last 24 Hours
  13 Jun 2026, 01:32 AM UTC | 48 stories
========================================================================

------------------------------------------------------------------------
  🏛️ POLITICS  (8 stories)
------------------------------------------------------------------------

  ⏱ 4.5h ago
  📰 Is India really home to 1.4 billion people? It's time to count - Nikkei Asia
  🔗 News | https://news.google.com/articles/CBMiqwFBVV95cUxPOUdodXRrY2JTak5xR1ZTenFMdzBk...

Plain text means it renders correctly in Gmail's plain-text mode, in Outlook, in Apple Mail, in mutt, and on a 2009 Nokia. No <table> gymnastics, no inline CSS, no images that get blocked. The optional make_pdf.py step generates a styled PDF for archive purposes, but the email is always text.

Numbers After 40 Days

The pipeline is consistent:

Metric Average Range
Raw articles fetched 612 410-810
After Pass 1 (URL unwrap) 587 395-780
After Pass 2 (title norm) 92 60-130
After Pass 3 (semantic) 51 38-72
Feeds that failed (per day) 0.8 0-3
Total runtime 47s 31s-78s
Email size 18 KB 11-32 KB

Three feeds (Scroll.in, The Wire, Deccan Herald) fail about once a week. The brief is still complete — failure-isolation is built into the per-feed try/except.

What I Cut From The Pipeline

Three things I tried and removed:

  1. An LLM-based deduplicator. I ran GPT-4o-mini over a sample of 50 borderline stories. It cost $0.14 per brief and took 12 seconds. The Jaccard pass was 0.62 accurate; GPT-4o was 0.68. Not worth it for a 6% improvement and 50x cost.
  2. Per-article sentiment scoring. Useful in theory, distracting in practice. A "mixed" sentiment label on every economy story was noise. Cut.
  3. Translating regional-language feeds. I tried adding Aaj Tak Hindi and Dinamalar Tamil. Translation was unreliable on a free tier, and most cross-posted stories already show up in English. Cut.

What's Next

The next iteration adds:

  • Stable de-duplication across days. Right now "PM Modi speaks in Parliament" and "PM Modi's Parliament speech recap" are different stories on different days. Cross-day dedupe would surface only the new angle.
  • Per-category token budget. A politics-heavy day (Rajya Sabha polls, foreign policy visit) currently dominates the brief. Cap each category at 6-8 stories and surface "what changed in category X since yesterday."
  • Story clusters with summaries. Group the surviving 51 stories into 8-10 clusters, generate a one-line summary per cluster via the same Groq free tier, and lead with the clusters.

The full code is in /home/workspace/Skills/india-daily/daily_brief.py is 293 lines including comments, make_pdf.py is 220. MIT licensed. Fork it, change the FEEDS list, point it at your Gmail, and you have a personal morning brief by the time the kettle boils.

git clone https://github.com/AmSach/india-daily
cd india-daily
python3 Scripts/daily_brief.py

If you build a regional variant — Kerala Daily, Karnataka Daily, North-East Daily — the dedupe + categorize layers carry over unchanged. The only thing that varies is the FEEDS list and the keyword trie.