可破解的个人新闻阅读器,使用 Bash 管道。
Hackable personal news reader in bash pipes

原始链接: https://github.com/haron/news.sh

## 基于Bash的个性化新闻阅读器 该脚本使用Bash创建可定制的新闻阅读器,旨在根据您的特定兴趣过滤RSS订阅。它需要`uv`、`jq`、`pandoc`和`bat`(可通过macOS上的`brew`安装),以及Gemini API密钥(或通过Simon Willison的`llm`工具使用其他LLM)。 **设置:** 在私有GitHub Gist中定义您的兴趣,并导出其ID (`GIST_ID`)。配置您的API密钥 (`GEMINI_API_KEY`)。然后,脚本会获取RSS订阅(可在脚本内轻松编辑),并根据您声明的兴趣进行过滤。 **定制:** 您可以调整翻译服务(当前为Perplexity或Google Translate),并使用`jq`过滤器指定应翻译的语言。脚本会自动将非英语条目包装在翻译链接中。提供调试模式以用于故障排除。 本质上,这提供了一个模板,可以直接从命令行构建个性化的新闻消费流程。

一个在Hacker News上分享的新项目提供了一个“可定制的个人新闻阅读器”,它使用bash管道构建,但主要利用`jq`、`feedparser`、`bat`和`pandoc`等工具,并结合LLM进行过滤。作者设想使用LLM并非作为传统的推荐引擎,而是作为基于明确定义的兴趣的*个人策展人*——这与以互动为驱动的“为你推荐”信息流不同。 评论者讨论了该项目的架构,指出LLM并非完成大部分工作。其他人分享了相关想法,例如使用情感分析来过滤社交媒体信息流,并质疑将LLM提示存储在单独的gist中的设计选择。一个失效的链接也被迅速识别并由作者修复。该项目引发了关于个性化信息消费替代方案的讨论。
相关文章

原文

A hackable personalized news reader in Bash. It filters RSS feeds based on your interests. Use it as a template for your own news-reading process.

You need uv, jq, bat and pandoc installed.

# macOS
brew install uv jq pandoc bat

You also need a Gemini API key, or configure a different LLM supported by Simon Willison's awesome llm tool.

export GEMINI_API_KEY="your-key"

Setup: Create Your Interests Gist

Create a new private gist with a file describing your interests (filename doesn't matter):

I am a recent immigrant to Germany, living in Munich.
I'm interested in:
- Systems programming, Rust, Go
- Apple hardware and macOS internals
- European politics
- Distributed systems
- NOT crypto, NOT AI hype

Copy the Gist ID from the URL: https://gist.github.com/username/<GIST_ID>

export GIST_ID="your-gist-id"
./news.sh

Or edit the script and hardcode your Gist ID:

GIST_ID="${GIST_ID:-"your_gist_id"}"

Edit the feeds call at the bottom of the script:

feeds \
    https://hnrss.org/best \
    https://your-favorite-feed.com/rss \
    &

No pandoc? No bat? Remove them from the pipeline in the format() function.

Non-English entries are auto-wrapped with a translation link. There are two places to customize:

  1. Change the translation service (top of the script)
# Default: Perplexity
TRANSLATION="https://www.perplexity.ai/search/?q=Summarize+the+webpage+in+English:+"

# Google Translate
TRANSLATION="https://translate.google.com/translate?sl=auto&tl=en&u="
  1. Change which languages get translated (jq filter in format())
# Default: translate everything except English
if (.lang == "en") then . else .link = ($prefix + .link) end

# Translate only Chinese and Russian:
if (.lang | IN("zh", "ru")) then .link = ($prefix + .link) else . end
  1. Change translation behavior in the prompt:
Translate all non-English titles into English.
# or
Keep all titles in their original language.
Variable Default Description
GIST_ID (required) Your interests Gist ID
LLM_MODEL gemini-3-flash-preview Model to use
GEMINI_API_KEY (required) Your Gemini API key
DEBUG (unset) Set to any value to enable debug mode
联系我们 contact @ memedata.com