omp packages

pi-reddit0.1.1

Read-only Reddit access for pi: Search, read posts, read comments

eliaskg Published 27 days ago MIT ~240 downloads/mo

Untested on omp

This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.

Did it work for you?

Result

One report per person. A new report replaces your old one.

Reports 0

No reports yet.

Readme

pi-reddit

npm version Download Stats license

Read-only Reddit tools for Pi. The extension exposes three tools:

  • reddit-search: keyword search across Reddit or inside subreddits.
  • reddit-top: top posts of a subreddit.
  • reddit-post: one post with its comment tree.

The tools use the official Reddit API with script-app credentials. They never write.

Install

pi install npm:pi-reddit

Restart Pi after installation.

Setup

Create ~/.pi/agent/reddit.json:

{
  "client_id": "your-script-app-id",
  "client_secret": "your-script-app-secret"
}

Create the credentials at https://www.reddit.com/prefs/apps as a "script" app.

All other settings are optional. Defaults apply when a key is missing:

{
  "userAgent": "pi-agent:pi-reddit:1.0 (by /u/yourname)",
  "limits": {
    "searchSelftextChars": 300,
    "postSelftextChars": 2000,
    "commentBodyChars": 1000,
    "defaultComments": 20,
    "maxComments": 50,
    "defaultLimit": 10
  }
}

Environment variables override the file credentials:

  • REDDIT_CLIENT_ID
  • REDDIT_CLIENT_SECRET

Examples

Search:

Search reddit for the best way to run llama.cpp on Linux.
Search reddit for the most capable local LLMs, last week only.

Top posts:

Show the top posts in r/programming this month.
What were the most discussed posts in r/programming last year?

Compare opinions:

Search r/LocalLLaMA for reactions to new model releases. Summarize pros and cons from the comments.

Rate limits

The client keeps at least one second between requests. On HTTP 429 it waits for the Retry-After value once, then errors. Access tokens are cached and refreshed once on HTTP 401.