Skip to content

Latest commit

 

History

History
54 lines (37 loc) · 1.34 KB

File metadata and controls

54 lines (37 loc) · 1.34 KB

orange 🍊 (vibecoded by clod)

Fetches the top stories from Hacker News and saves them as bookmarks in Karakeep, tagged #hackernews. Most everything done by Clod.

Requirements

  • Python 3.10+

Setup

cp .env.example .env
# Edit .env with your Karakeep URL and API token

Get your API token from Karakeep: Settings → API Keys.

Usage

# 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 --override

Sample output

Fetching 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.

What it does

  1. Fetches the top N story IDs from the HN Firebase API
  2. For each story, checks local state (~/.config/orange/state.json) — skips if already submitted
  3. Creates a bookmark in Karakeep with the title and URL
  4. Tags each bookmark with hackernews
  5. Sleeps 2 seconds between requests to be polite to the HN API