iTranslated by AI

The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article
📰

Automating Daily Tech News Summaries with Claude Code

に公開

Problem: Information Gathering Doesn't Last

As an engineer, keeping up with tech trends is important. We know in our heads that we should check GitHub Trending and Hacker News every morning, look through interesting repositories and articles...

But in reality, it doesn't last.

Even if you set up an RSS reader, it ends up with "1000 unread" and you stop looking at it. Even if you glance at an X timeline, it just flows by. Eventually, the "read later" list piles up and never gets digested.

What I really want isn't "time to read all the primary sources," but "a digest-level summary that I can explain to someone." The kind of information where, if asked "What was trending on GitHub yesterday?" I can answer within 30 seconds.

So I built a "Daily Feed" using Claude Code.

What I Built

An automated system that fetches tech news from 5 sources and has Claude Code generate a markdown file with summaries.

Sources:

  • GitHub Trending (daily)
  • Hacker News (top articles from the past 24 hours)
  • Reddit (r/programming, r/MachineLearning)
  • Zenn (daily trend)
  • Qiita (most bookmarked posts recently)

Output example:

# 2026-03-24 Daily Feed

## GitHub Trending

### TradingAgents — Financial trading framework with multiple LLM agents collaborating

A framework where multiple AI agents take on roles such as analyst, trader, and risk manager
and make trading decisions for stocks and crypto assets. Instead of a single LLM,
it uses a multi-agent design where each agent provides specialized market analysis and
risk assessment.

🔗 https://github.com/TauricResearch/TradingAgents

## Hacker News

### iPhone 17 Pro demonstrates running a 400B parameter local LLM (527pt, 249 comments)

A demo showing a 400B parameter large language model running on a smartphone alone.
The ability to perform high-precision LLM inference on mobile without cloud APIs
is attracting attention from perspectives of privacy, latency, and offline use.

🔗 https://twitter.com/anemll/status/...

By reading this, you can explain "what happened yesterday" to someone without having to visit 5 different sites.

Design: Shell Script + Claude Code

I split the process into two phases.

Phase 1: Raw data fetching (shell script, no AI)
    Fetch data from 5 sources using curl/jq
    ↓
Phase 2: AI summarization (Claude Code)
    Read raw data and generate feed.md with summaries

Why split it? Data fetching can be done perfectly well with curl/jq. There's no point in having AI make HTTP requests. By minimizing what we leave to AI, the system becomes easier to debug and more stable.

How Each Source is Fetched

All 5 scripts (each 40–57 lines) use free, authentication-free APIs.

GitHub Trending: RSS Feed

GitHub Trending has no official API. Instead, we use an RSS feed provided by the community (mshibanami/GitHubTrendingRSS).

# Fetch RSS XML with curl and parse with awk/sed
XML=$(curl -s "https://mshibanami.github.io/GitHubTrendingRSS/daily/all.xml")

# Extract title, link, and description from <item> tags
echo "$XML" | awk '
  /<item>/ { in_item=1; title=""; link=""; desc="" }
  /<\/item>/ {
    if (in_item && title != "") {
      print title "|" link "|" desc
    }
    in_item=0
  }
  # ... Extract each field
' | head -10

We process the XML without an XML parser, using awk/sed, so that it works even in environments without xmllint. HTML escape decoding (e.g., &amp; → &) is also done manually.

Hacker News: Algolia Search API

Hacker News has a search API provided by Algolia. It allows filtering by date range and sorting by score.

# Fetch stories from the past 24 hours sorted by score
RESPONSE=$(curl -s "https://hn.algolia.com/api/v1/search?\
tags=story&\
numericFilters=created_at_i%3E${SINCE_TS},created_at_i%3C${UNTIL_TS}&\
hitsPerPage=30")

# Sort by score using jq and safely process each item via base64 encoding
echo "$RESPONSE" | jq -r \
  '[.hits | sort_by(-.points)][0][] | @base64'

Key point: @base64 pipe. Each JSON element is base64-encoded before being decoded one by one in a while loop. This pattern safely handles JSON containing newlines or pipe characters.

Reddit: Public JSON API

Reddit's JSON API requires a User-Agent header. A 2-second sleep is added for rate limiting.

UA="MyFeedBot/1.0"
SUBREDDITS=("programming" "MachineLearning")

for SUB in "${SUBREDDITS[@]}"; do
  RESPONSE=$(curl -s -H "User-Agent: ${UA}" \
    "https://www.reddit.com/r/${SUB}/top.json?t=day&limit=5")

  # Validate response (API might be down)
  if ! echo "$RESPONSE" | jq -e '.data.children' > /dev/null 2>&1; then
    echo "(Fetch failed)" >> "$OUTPUT_FILE"
    sleep 2
    continue
  fi
  # ...
  sleep 2  # Rate limit mitigation
done

The Reddit API can be unstable (there were actual fetch failures). The response is validated with jq -e, and if it fails, the script logs "(Fetch failed)" and continues.

Zenn: Official API

Zenn's API provides daily trends via /api/articles?order=daily.

RESPONSE=$(curl -s 'https://zenn.dev/api/articles?order=daily&count=30')

# Tricky part: timezone conversion
# published_at: "2026-03-20T08:07:00.679+09:00"
# jq's fromdateiso8601 cannot handle the +09:00 format
# → Extract first 19 characters and compare as UTC
SINCE_ISO=$(date -r "$SINCE_TS" +%Y-%m-%dT%H:%M:%S)
FILTERED=$(echo "$RESPONSE" | jq -r \
  --arg since "$SINCE_ISO" \
  '[.articles[] |
    select((.published_at | split(".")[0]) >= $since)
  ] | .[0:10][] | @base64')

The subtle pitfall is timezone conversion. Zenn's published_at is in ISO 8601 format with +09:00, but jq's fromdateiso8601 cannot handle this format. We sidestep this by extracting the first 19 characters before the decimal point (yyyy-mm-ddTHH:MM:SS) and comparing as local time.

Qiita: Official API v2

Qiita's API allows query searches via /api/v2/items. We filter for items with 3 or more bookmarks using stocks:>3.

# Only date precision (yyyy-mm-dd) supported; passing time causes 500 error
SINCE_DATE=$(date -r "$SINCE_TS" +%Y-%m-%d)
UNTIL_DATE=$(date -r "$UNTIL_TS" +%Y-%m-%d)

RESPONSE=$(curl -s \
  "https://qiita.com/api/v2/items?per_page=10&\
query=stocks%3A%3E3+created%3A%3E%3D${SINCE_DATE}+created%3A%3C%3D${UNTIL_DATE}")

A note about the Qiita API: the search query date only accepts yyyy-mm-dd precision. Passing time (yyyy-mm-ddTHH:MM:SS) returns a 500 error.

Batch Fetch Script

run-all.sh is the entry point that sequentially calls the five individual scripts.

#!/bin/bash
# Fetch feeds from all sources
# Usage: bash run-all.sh <output_dir> <since_ts> <until_ts>

SCRIPTS=(
  "fetch-github-trending.sh"
  "fetch-hackernews.sh"
  "fetch-reddit.sh"
  "fetch-zenn.sh"
  "fetch-qiita.sh"
)

FAILED=0
for SCRIPT in "${SCRIPTS[@]}"; do
  echo "→ ${SCRIPT}..."
  if bash "${SCRIPT_DIR}/${SCRIPT}" "$OUTPUT_DIR" "$SINCE_TS" "$UNTIL_TS"; then
    echo ""
  else
    echo "  ✗ FAILED: ${SCRIPT}" >&2
    FAILED=$((FAILED + 1))
  fi
done

echo "=== Done: $((${#SCRIPTS[@]} - FAILED))/${#SCRIPTS[@]} succeeded ==="

The total for all scripts is about 250 lines. They accept a UNIX timestamp as a common interface and convert it to each API's required format. If one fails, the others continue.

AI Summary: Raw Data → feed.md

The raw data obtained in Phase 1 looks something like this.

## 1. TauricResearch/TradingAgents
- URL: https://github.com/TauricResearch/TradingAgents
- Description: TradingAgents: Multi-Agents LLM Financial Trading Framework <img src="https://raw.github...

It's a URL with a 200-character description and HTML tag clutter. This is far from "explainable to others."

Claude Code summarizes it with the following rules.

  1. Each article title should be a descriptive Japanese headline (a paraphrase, not the literal original title)
  2. The summary should sufficiently explain the article's content (enough to discuss the topic with someone after reading)
  3. Place the original source URL at the end (as an option for "want to learn more")
  4. Maintain objectivity (neutral, as a feed for quick knowledge)

As a result, the same repository transforms like this.

### TradingAgents — A Multi-LLM Agent Collaborative Financial Trading Framework

A framework where multiple AI agents take on roles such as analyst, trader, and risk manager
and collaborate to make trading decisions for stocks and cryptocurrencies.
Rather than relying on a single LLM, this multi-agent design allows each agent to perform
market analysis and risk assessment from a specialized perspective.
It is geared toward research and backtesting rather than live trading, but it has gained
significant attention as a practical implementation combining LLMs with finance.

🔗 https://github.com/TauricResearch/TradingAgents

The raw data's "200-character description with HTML clutter" transforms into a technical background explanation that includes "why it's gaining attention." This is generated daily across all five sources.

Summary

  • Total script size: about 250 lines. All use free APIs without authentication.
  • Design principle: Separation of concerns between data fetching (shell) and AI summarization (Claude Code). Minimize what is handed over to AI.
  • Handling API quirks: Subtle but practically important pitfalls like Zenn's timezone conversion, Qiita's date precision limit, and Reddit's rate limiting.
  • Resilience to partial failures: If one source goes down, the others continue processing.

Manually running claude -p "gather feeds" takes about 5 minutes. It's convenient.

However, if it's manual, you will absolutely skip it. An information gathering tool dies without a "habit of use." The worst pattern is building it, feeling satisfied, and abandoning it.

In the next article, I will cover how to automate this feed generation every morning and have it delivered via email.

References

GitHubで編集を提案

Discussion