Merge branch 'codex/production-intelligence-terminal' into codex/issue-3-acled-diagnostics-auth-tests
This commit is contained in:
@@ -16,3 +16,4 @@ Source docs:
|
||||
- [Telegram](telegram.md)
|
||||
- [FIRMS](firms.md)
|
||||
- [Maritime](maritime.md)
|
||||
- [Reddit](reddit.md)
|
||||
|
||||
33
docs/sources/reddit.md
Normal file
33
docs/sources/reddit.md
Normal file
@@ -0,0 +1,33 @@
|
||||
# Reddit Source
|
||||
|
||||
Reddit is used as a social sentiment input for selected geopolitical and market subreddits.
|
||||
|
||||
## Configuration
|
||||
|
||||
Create a Reddit script app at:
|
||||
|
||||
```text
|
||||
https://www.reddit.com/prefs/apps/
|
||||
```
|
||||
|
||||
Then set:
|
||||
|
||||
```env
|
||||
REDDIT_CLIENT_ID=
|
||||
REDDIT_CLIENT_SECRET=
|
||||
```
|
||||
|
||||
## Runtime Behavior
|
||||
|
||||
- The source uses the OAuth client credentials flow and then reads `https://oauth.reddit.com`.
|
||||
- Unauthenticated `reddit.com/.../hot.json` scraping is intentionally disabled.
|
||||
- Missing credentials return `status: no_credentials` and are surfaced as source degradation.
|
||||
- OAuth failures return `status: auth_failed` without logging or returning the client secret.
|
||||
- Subreddit fetch failures return `status: degraded` with per-subreddit errors.
|
||||
|
||||
## Test
|
||||
|
||||
```bash
|
||||
node apis/sources/reddit.mjs
|
||||
npm run test:unit
|
||||
```
|
||||
Reference in New Issue
Block a user