Skip to content

About

Zero-paid-API, zero-dependency Python stdlib RSS/Atom/arXiv feed radar with SQLite URL deduplication & daily Markdown briefings | 零付费 API 纯标准库 RSS/Atom 信息雷达与每日简报

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

Info Radar · 个人信息雷达

skills.sh

一个零付费 API、仅使用 Python 标准库的 RSS/Atom 信息雷达。它会抓取公开订阅源,按栏目筛选和去重,将新条目写成 Markdown 简报,并用 SQLite 记录已经看过的链接。

English Summary: Zero-paid-API, zero-dependency Python 3.10+ standard-library RSS 2.0 / RSS 1.0 (RDF) / Atom feed radar and Agent Skill—featuring tracking-parameter stripping (utm_*, fbclid, gclid), canonical URL deduplication via SQLite, weighted keyword/exclusion filtering across topic sections, Markdown briefing generation (reports/latest.md), and hardened systemd timer deployment.

安装 Agent Skill(Claude Code / Codex / Cursor / Antigravity)

npx skills add Ferryyer/info-radar

默认配置包含三个栏目:

  • 生物医学工程;
  • 人工智能与 Agent Skills;
  • 诗与文学。

项目只保存来源提供的标题、简短摘要和原文链接,不下载完整文章或诗歌。匹配分表示关键词命中程度,不代表内容质量,也不构成事实核查。

特性

  • 支持 RSS 2.0、RSS 1.0/RDF 和 Atom;
  • 自动移除常见跟踪参数并按规范化 URL 去重;
  • 支持栏目关键词、标题排除词、最低分数和每栏条数限制;
  • 单个来源失败时继续生成简报,所有来源失败时返回非零状态;
  • 生成 Markdown 历史简报和 latest.md;
  • 无第三方 Python 依赖。

快速开始

需要 Python 3.10 或更高版本。

git clone https://github.com/Ferryyer/info-radar.git
cd info-radar
python3 radar.py

首次运行会扫描 config.json 设置的近期条目。之后再次运行时,只会把未收录过的匹配项列为新条目。

运行产物:

  • reports/latest.md:最近一次简报;
  • reports/YYYY-MM-DD_HHMMSS.md:历史简报;
  • state/radar.sqlite3:去重状态数据库。

这些目录已被 .gitignore 排除,不会提交到仓库。

配置

编辑 config.json 即可增删来源、栏目和关键词:

  • lookback_days:只处理最近多少天的条目;
  • sources:订阅源名称、栏目和 URL;
  • terms:栏目关键词;
  • exclude_titles:标题排除词;
  • min_score:关键词模式下的最低匹配分;
  • max_items:每栏在简报中展示的最大条数;
  • all: true:不做关键词筛选,收录该来源或栏目的所有新条目;
  • no_excerpt: true:不在简报中写入来源摘要。

使用其他配置文件:

python3 radar.py --config /path/to/config.json

如果当前网络可以访问 arXiv RSS,可在 sources 中加入:

{
  "name": "arXiv · Artificial Intelligence",
  "section": "人工智能与 Agent Skills",
  "url": "https://rss.arxiv.org/rss/cs.AI"
}

测试

测试使用内置样例,不访问网络:

python3 -m unittest discover -s . -p 'test_*.py' -v

使用 systemd 定时运行

仓库提供了 info-radar.service 和 info-radar.timer 示例,默认安装路径为 /opt/info-radar,每天北京时间约 08:00 运行。

sudo useradd --system --home-dir /nonexistent --shell /usr/sbin/nologin info-radar
sudo cp -R . /opt/info-radar
sudo install -d -o info-radar -g info-radar /opt/info-radar/state /opt/info-radar/reports
sudo cp info-radar.service info-radar.timer /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable --now info-radar.timer

检查定时器和最近一次运行:

systemctl list-timers info-radar.timer
systemctl status info-radar.service
journalctl -u info-radar.service -n 50 --no-pager

若使用其他安装路径,请同步修改 service 文件中的 WorkingDirectory、ExecStart 和 ReadWritePaths。

隐私与安全

  • 配置文件只需要公开 RSS/Atom URL,不需要 API 密钥;
  • state/ 和 reports/ 可能反映个人阅读兴趣,默认不会被 Git 跟踪;
  • systemd 示例启用了只读系统、独立临时目录和禁止提权等限制;
  • RSS 内容来自外部网站,打开链接前仍应自行判断来源可信度。

许可证

本项目采用 PolyForm Noncommercial License 1.0.0,允许非商业用途使用、修改和分发;商业授权需另行取得许可。

About

Zero-paid-API, zero-dependency Python stdlib RSS/Atom/arXiv feed radar with SQLite URL deduplication & daily Markdown briefings | 零付费 API 纯标准库 RSS/Atom 信息雷达与每日简报

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages