vaibhav0806/tech-digest
GitHub: vaibhav0806/tech-digest
聚合 Hacker News 和 Product Hunt 热门内容并提供 Web 界面与 Telegram 推送的轻量级信息订阅工具。
Stars: 0 | Forks: 0
# 技术摘要
**[techdigest.live](https://techdigest.live)**
聚合 Hacker News 和 Product Hunt 的热门帖子到单一 feed 中,采用简洁的深色 UI。可选择将每日摘要发送到 Telegram 频道。

## 功能
- **HN + Product Hunt 抓取** — HN 的热门故事(top & show)以及最新的 Product Hunt 发布
- **Web UI** — 具有深色主题的可过滤 feed,通过 session cookies 实现用户个人书签
- **Telegram 摘要** — 每日广播各来源前 10 条内容到频道
- **零认证** — 书签使用匿名 cookie 会话,无需注册
## 设置
```
# Install dependencies
uv sync
# Populate the database
python scrape_job.py
# Start the server
uvicorn tech_digest.app:app --reload
```
打开 [http://localhost:8000](http://localhost:8000)。
## 环境变量
| Variable | Description | Required |
|---|---|---|
| `SCRAPE_SECRET` | `POST /scrape` endpoint 的 Bearer token | 是 |
| `TELEGRAM_BOT_TOKEN` | Telegram bot token | 否 |
| `TELEGRAM_CHANNEL_ID` | Telegram 频道(`@handle` 或数字 ID) | 否 |
| `DATABASE_PATH` | SQLite DB 路径(默认:`./data/products.db`) | 否 |
| `PORT` | 服务器端口(默认:`8000`) | 否 |
## API
| Endpoint | Method | Description |
|---|---|---|
| `/` | GET | Feed 页面,可选 `?source=hn\|ph` 过滤器 |
| `/bookmarks` | GET | 用户收藏的项目 |
| `/bookmark/{id}` | POST | 切换收藏状态 |
| `/scrape` | POST | 触发抓取 + Telegram 摘要(需要 `Authorization: Bearer `) |
## 项目结构
```
hackernews-scraper/
├── tech_digest/
│ ├── __init__.py # package marker
│ ├── app.py # FastAPI app + routes
│ ├── config.py # all env vars
│ ├── db.py # SQLite database layer
│ ├── scraper.py # HN + Product Hunt scrapers
│ ├── services.py # shared scrape orchestration
│ └── telegram.py # Telegram digest sender
├── templates/
│ └── index.html
├── scrape_job.py # CLI entry point
├── pyproject.toml
├── Procfile
└── README.md
```
## 部署
包含用于 Heroku / Railway / Render 的 `Procfile`:
```
web: uvicorn tech_digest.app:app --host 0.0.0.0 --port ${PORT:-8000}
```
设置 cron 作业或调度程序以定期请求 `POST /scrape`。
## 技术栈
FastAPI, SQLite (WAL mode), httpx, BeautifulSoup, Jinja2
标签:AV绕过, FastAPI, Hacker News, Product Hunt, Python, Splunk, SQLite, Telegram 机器人, URL抓取, UVicorn, Web Scraping, 信息流, 内容分发, 开源, 数据抓取, 无后门, 每日摘要, 深色模式, 科技资讯, 科技趋势, 网络调试, 聚合器, 自动化, 自托管, 运行时操纵, 逆向工具