Skip to content

docs: an example that ranks a nostr feed with Jev - #31

Merged
sepehr-safari merged 1 commit into
mainfrom
notes-ranked-by-jev
Sep 24, 2026
Merged

sepehr-safari merged 1 commit into
mainfrom
notes-ranked-by-jev

Conversation

@sepehr-safari

Copy link
Copy Markdown
Contributor

Closes #30

examples/jev/rank-notes.sh: deed fetches the newest notes from five relays into a local store, the script drops empty notes and the JSON app data some clients publish as kind:1, and Jev answers three questions per note (topic as a Choice, substance as a Score, spam as a Noul). Thresholds for spam and for an uncertain topic are constants in the script. Requests run eight at a time; 429, 5xx and dropped connections are retried with backoff, anything else skips that note and says why.

Verified:

  • a paid run over 1,000 notes: 629 judged, 157 dropped as spam, 539,784 input tokens, about $0.023 (numbers in the example's README)
  • a hand-read sample of 100 notes to see what the spam threshold drops
  • --dry-run and a paid run under macOS's /bin/bash 3.2, after making xargs start the same bash that runs the script (a bash 5 child cannot read functions exported by 3.2)
  • shellcheck clean

Also: the skill gets a short section pointing at the example (and telling an agent to dry-run first and ask before a paid run), the README gets an Examples section, and CI's ASCII and parse checks now cover examples/*/*.sh.

examples/jev/rank-notes.sh fetches the newest notes from five relays into a local store, drops the app data some clients publish as kind:1, and asks Jev three typed questions about each note (topic, substance, spam). The thresholds that decide what is spam and when a topic is too uncertain are constants at the top of the script. Rate limits and server errors are retried with a growing pause; any other failure skips that note. --dry-run prints the requests without calling the API.

The README records a real run over 1,000 notes and what it cost, and what to watch for: automated news posts near the spam line, replies judged without their parent, lower accuracy outside English. The skill and the README point at it, and CI now checks that example scripts parse and stay ASCII.
@sepehr-safari
sepehr-safari merged commit db13280 into main Sep 24, 2026
2 checks passed
@sepehr-safari
sepehr-safari deleted the notes-ranked-by-jev branch September 24, 2026 12:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

An example that ranks a feed with a classifier

1 participant