GitHub Trending scrapingBefore starting: First say "开始抓 GitHub 榜单 🐙" and state today's date and the scraping period (defaults to the weekly list).
Scrape GitHub Trending → score and mark with keywords → write an Obsidian note. Pure Python script, zero tokens.
Step 0: Read the shared configuration
The configuration is in ../_shared/user-config.json, and the personal override is in ../_shared/user-config.local.json(if it exists, local takes precedence).
Inside the script it is already loaded automatically via ../_shared/user_config.py , so there is no need to pass parameters manually. Relevant fields:
paths.obsidian_vault— vault root pathpaths.github_trending_folder— output folder (defaultGitHubTrending)daily_papers.keywords / negative_keywords / domain_boost_keywords— reuse them to score projects and mark relevance
Parse the period and language
Parse from the user input --since:
- "周榜", "过去一周", "这周", "本周" →
--since weekly(default) - "日榜", "今天", "今日" →
--since daily - "月榜", "这个月", "本月" →
--since monthly
Optional --language(e.g. "只看 Python" → --language python); if not specified, scrape all languages.
Workflow
Phase 1: Scrape + score (fetch_trending.py)
python3 fetch_trending.py --since weekly > /tmp/github_trending.json
# 指定语言示例:
# python3 fetch_trending.py --since weekly --language python > /tmp/github_trending.json
The script automatically completes:
- Scrape
github.com/trending?since=<周期>(compatible with SSL interception environments, automatically falls back to not verifying certificates) - regex parsing: repo, description, language, cumulative star/fork, stars added in this period
- Score with the shared configuration keywords, mark
relevant(matches positive/domain words and is not outweighed by negative words),do not discard non-related items - Sort in descending order by stars added in this period
Check the output: Confirm that /tmp/github_trending.json is a non-empty JSON array. If it is empty, look at the stderr diagnostics.
Phase 2: Write the Obsidian note (write_trending_note.py)
python3 write_trending_note.py /tmp/github_trending.json
- Output to
{vault}/{github_trending_folder}/ - The weekly list filename is based on the ISO week number, e.g.
2026-W28 GitHub周榜.md; the daily/monthly lists use the date - Note structure: summary → "🎯 与研究方向相关" list → "📊 完整榜单" table (including ✅ relevance markers)
- The script prints the final note path to stdout
Output
After completion, inform the user:
- How many projects were scraped, and how many of them are related to the research direction
- The path of the generated note
Notes
- Neither script starts a Task Agent, so there is zero token consumption
- Do not perform git operations(consistent with daily-papers, git automation is off by default)
- When the network is unavailable, refer to the proxy rules in the global CLAUDE.md (port 17890); the script already has an SSL fallback built in
- GitHub Trending only has three tiers, daily/weekly/monthly, and cannot be customized to any number of days