Dev.to AI πŸ€– Ai πŸ‘ 0 πŸ“– 4 min read

Zero-Proxy 128MB Google News Scraper: 5-in-1 URL Decoder, Streaming RAG & Crisis Triggers (MCP v2.8)

If you have ever tried to feed Google News into an LLM/RAG pipeline, a PR crisis monitor, or a B2B sales trigger workflow, you probably hit the same four walls within 20 minutes: Obfuscated news.google.com/rss/article

If you have ever tried to feed Google News into an LLM/RAG pipeline, a PR crisis monitor, or a B2B sales trigger workflow, you probably hit the same four walls within 20 minutes:

  1. Obfuscated news.google.com/rss/articles/CBMi... redirect URLs that broke base64 decoding in late 2024 and now require Google's internal batchexecute RPC (Fbv4je) β€” or spawning a 2–4 GB headless Chromium container just to follow a link.
  2. Instant HTTP 429 rate limits when spoofing desktop Chrome/126 User-Agent headers from Node.js/Python (TLS JA3 fingerprint mismatch).
  3. 1.5–3 MB bloated publisher HTML pages packed with inline <script>, <style>, and <svg> payloads that OOM small containers when extracting full article text for RAG.
  4. Paywalled Tier-1 links (WSJ, Reuters, Nature) returning 80-word teasers, plus duplicate cross-lingual coverage billing you repeatedly on scheduled cron runs.

We solved all four inside a 128 MB pure-HTTP Node.js 22 container (zero Puppeteer/Playwright, zero residential proxy requirement) and measured it live on Apify Cloud AWS Linux containers:

Cloud Run Mode (128 MB Linux) Peak RAM Wall Time Verified Live Output
Mode A (news_headlines_intel Β· EN + KO + JA) 53.97 MB 7.85s 15/15 (100%) real publisher URLs decoded across US:en, KR:ko, JP:ja
Mode B (full_article_rag Β· TECHNOLOGY) 48.94 MB 4.38s 8/8 (100%) full-text articles, 72% streaming HTML RAM savings (4.65 MB β†’ 1.30 MB), 26 512-token RAG chunks, 0% block rate, 1 paywall sibling rescued

Here are the five architectural patterns that made it work.

1. Honest-UA 5-in-1 batchexecute URL Decoding + Automatic Bing News Fallback

Two empirical findings changed everything for Google News URL decoding:

  • Stop spoofing desktop Chrome UAs from pure HTTP. Spoofing Chrome/126 on /articles/... triggered HTTP 429 within ~15 requests due to TLS fingerprint mismatch. Using an honest product User-Agent on /rss/articles/... to extract the data-n-a-sg, data-n-a-ts, and data-n-a-id tokens β€” and packing 5 URLs into a single Fbv4je batchexecute POST β€” cuts RPC round-trips by 80% and returned HTTP 200 cleanly.
  • Automatic 5 β†’ 1 split fallback + Bing News direct-URL engine. If any 5-item batch hits a malformed token or partial failure, the decoder automatically splits and retries individually. And if Google News RSS itself returns 429/503, discovery seamlessly fails over to Bing News RSS, which already embeds unobfuscated canonical publisher URLs in its url= query parameter (zero decode hops).

2. On-the-Fly Streaming HTML Tag-Stripper (72–79% RAM Reduction)

Traditional article extractors buffer the entire raw HTML response (1.2–3.0 MB on modern news sites) into a V8 string and build a DOM tree with Cheerio or JSDOM. Inside a 128 MB container with 6 concurrent fetches, that spikes RSS fast.

Instead, we read ReadableStream chunks incrementally and strip <style>, <svg>, <noscript>, HTML comments (<!-- ... -->), and non-JSON-LD <script> blocks on the fly before they ever accumulate in memory, while capturing <script type="application/ld+json"> blocks into a bounded side buffer (even when they sit at the very bottom of the HTML document):

  • Raw publisher HTML in our 128 MB Linux cloud run: 4.65 MB
  • Clean HTML retained in memory: 1.30 MB (72% reduction; up to 86% on heavy sites like CNBC)
  • Combined with 50-article streaming dataset batches (flushing and releasing cleanPlainText / ragChunks every 50 items), a 2,000-article full-text RAG run stays flat inside 128–256 MB RAM.

3. 3-Layer Paywall Rescue (Cluster-Sibling Full-Text Recovery)

When a publisher returns 403, 429, or a paywall teaser (isAccessibleForFree: false or < 120 CJK-normalized words):

  1. Layer 1: Extract structured JSON-LD NewsArticle.articleBody + streaming clean HTML paragraphs.
  2. Layer 2: If truncated and <link rel="alternate" type="application/rss+xml"> is advertised, fetch the publisher's official RSS feed and match strictly by canonical URL or >= 0.75 title token overlap (never grabbing an unrelated recent post from a site-wide feed).
  3. Layer 3 (Cluster-Sibling Rescue): Google News RSS <description> embeds curated <ol><li> alternate publishers covering the exact same breaking story at $0. When a paywalled or blocked outlet fails Layers 1–2, we decode up to 2 curated siblings and recover the full text from an open outlet (extractionStatus: "RESCUED_FROM_SIBLING" + rescuedFromPublisher / rescuedFromUrl), preserving full audit provenance.

4. CJK-Safe Word Counting, Negation-Aware Crisis NLP & Cross-Lingual Clustering

Whitespace word splitting (text.split(/\s+/).length) breaks on Japanese and Chinese articles β€” a 1,800-character WIRED.jp article has almost zero spaces and gets misclassified as paywall-truncated. Normalizing effective word count as spaceWords + Math.round(cjkChars * 0.55) lifted live Japanese full-text classification (WIRED.jp, Yahoo!ニγƒ₯γƒΌγ‚Ή, ζ—₯ζœ¬η΅ŒζΈˆζ–°θž) to 3/3 (100% FULL).

We also run zero-LLM deterministic NLP across 5 core languages (EN, KO, JA, DE, ES) with SOV post-position negation awareness (so "ꡬ쑰쑰정 κ³„νš μ—†λ‹€" / "δΊΊε“‘ε‰ŠζΈ›γ‚’θ¦‹ι€γ‚Š" / "denies layoff rumors" sets negationSuppressed: true and crisisAlert: false), plus optional BYOK LLM escalation (OpenAI / Anthropic / Gemini) only for high-urgency or unsupported-locale articles.

5. Race-Free Immutable Run-Delta watchDiff ($0 Pre-Decode Skips)

Google News rotates its redirect tokens between runs, so URL-only deduplication fails and re-bills the same headline. Our watchDiff engine hashes three pre-decode keys β€” canonical URL, normalized headline + publisher domain, and entity + publisher + UTC day β€” and writes immutable delta_<hash>_<ts>_<rand> records (compacting cleanly every 5 runs) so parallel schedules never clobber each other and previously seen stories are skipped before URL decoding at $0.

Try It Live (Zero-Install MCP, Apify Actor, or Open-Source n8n / Clay / Make Kit)

{
  "mcpServers": {
    "apify-b2b-ecom-mcp": {
      "url": "https://apify-factory-rapidapi-gateway.apify-factory-rapidapi-gateway.workers.dev/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_APIFY_TOKEN"
      }
    }
  }
}
πŸ“° Read the original article on Dev.to AI

Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes β€” full credit and traffic to the original publisher.