papernews/README.md
Dave Campbell e31282cbb5 Initial release of Papernews
Daily AI-curated newspaper PDF delivered via Telegram. Fetches RSS feeds,
summarizes top stories with Claude, compiles a LaTeX PDF in newspaper layout.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-08 12:41:55 +00:00

108 lines
3.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Papernews
A self-hosted daily newspaper delivered to your Telegram. Fetches RSS feeds from your chosen news sources, summarizes the top stories with Claude AI, and compiles everything into a clean newspaper-style PDF — once a day, no feeds to scroll, no algorithm pulling you back.
Inspired by a Reddit post on r/RemarkableTablet.
![Sample Papernews PDF showing newspaper-style layout with sections](screenshot.png)
## How it works
1. RSS feeds are fetched from configured news sources
2. Claude picks and summarizes the 46 most newsworthy stories per section
3. A LaTeX PDF is compiled in newspaper layout (two-column, masthead header)
4. The PDF is delivered to your Telegram chat
5. PDFs older than 5 days are automatically pruned
## Requirements
- Docker + Docker Compose
- A Telegram bot token (create one via [@BotFather](https://t.me/botfather))
- An [Anthropic API key](https://console.anthropic.com)
## Setup
**1. Clone the repo**
```bash
git clone https://github.com/yourusername/papernews.git
cd papernews
```
**2. Configure**
```bash
cp .env.example .env
```
Edit `.env` and fill in:
- `TELEGRAM_BOT_TOKEN` — from @BotFather
- `TELEGRAM_CHAT_ID` — your Telegram user ID (send `/start` to [@userinfobot](https://t.me/userinfobot) to find it)
- `ANTHROPIC_API_KEY` — from [console.anthropic.com](https://console.anthropic.com)
- `LOCATION` — shown in the masthead (e.g. `Kansas City, Missouri`)
**3. Build and run**
```bash
docker compose up -d --build
```
The container will start and wait for the scheduled time. To test immediately:
```bash
docker compose run --rm -e RUN_NOW=true papernews
```
## Configuration
All configuration is via environment variables in `.env`:
| Variable | Default | Description |
|---|---|---|
| `TELEGRAM_BOT_TOKEN` | required | Bot token from @BotFather |
| `TELEGRAM_CHAT_ID` | required | Your Telegram chat ID |
| `ANTHROPIC_API_KEY` | required | Anthropic API key |
| `LOCATION` | `Your City` | City/region shown in the masthead |
| `SCHEDULE_HOUR` | `7` | Hour to deliver (24-hour) |
| `SCHEDULE_MINUTE` | `0` | Minute to deliver |
| `TIMEZONE` | `America/Chicago` | Any IANA timezone name |
| `RETENTION_DAYS` | `5` | Days to keep PDFs before pruning |
| `RUN_NOW` | `false` | Set `true` to run immediately on start |
## Customizing news sources
Edit the `SECTIONS` list in `papernews.py`. Each section has a title and a list of RSS feed URLs:
```python
SECTIONS = [
{
"title": "Local --- My City",
"feeds": [
("Local Paper", "https://localpaper.com/feed"),
("Local TV", "https://localtv.com/rss"),
],
},
{
"title": "National",
"feeds": [
("AP News", "https://feeds.apnews.com/rss/apf-topnews"),
("NPR", "https://feeds.npr.org/1001/rss.xml"),
],
},
# add as many sections as you like
]
```
The `---` in section titles renders as an em dash in the PDF.
## Checking logs
```bash
docker logs papernews
```
## Notes
- The Docker image is ~700MB due to the LaTeX install. This is a one-time cost.
- PDFs are saved to `./output/` and pruned automatically.
- The bot token is only used to send outbound documents — the container does not poll for incoming messages.
## License
MIT — see [LICENSE](LICENSE).