Fetches the top stories from Hacker News and saves them as bookmarks in Karakeep, tagged #hackernews. Most everything done by Clod.
- Python 3.10+
cp .env.example .env
# Edit .env with your Karakeep URL and API tokenGet your API token from Karakeep: Settings → API Keys.
# Import top 100 stories (default)
python orange.py
# Import top 25 stories
python orange.py -n 25
# Re-submit all stories, ignoring local state
python orange.py --overrideFetching Hacker News top stories...
[████████████░░░░░░░░░░░░░░░░░░] submitted: 18 skipped: 2
sent: Show HN: I built a terminal RSS reader in Go
https://github.com/example/rss-reader
At completion:
[██████████████████████████████] submitted: 47 skipped: 3
Done.
- Fetches the top N story IDs from the HN Firebase API
- For each story, checks local state (
~/.config/orange/state.json) — skips if already submitted - Creates a bookmark in Karakeep with the title and URL
- Tags each bookmark with
hackernews - Sleeps 2 seconds between requests to be polite to the HN API