Users report that Reddit share links of the form https://www.reddit.com/r/<subreddit>/s/<token> are not handled.
These 302-redirect to the canonical post. Follow the redirect, then read the resolved post's comments.json to get the author.
Extracts: post author username, subreddit, canonical post URL, post title.
Where the code goes
- New module
sharetrace/modules/reddit.py — one function, returns {"data": {...}} or {"error": "..."}.
- Register it in
router.py: URL pattern plus an entry in PARSERS.
- Add output labels in
output.py.
- Unit test in
tests/test_unit_modules.py — copy the shape of TestTelegram. Mock both the redirect and the JSON response.
- Add a row to the supported-sources table in
README.md.
How you verify it — no credentials, no network
pytest tests/ --ignore=tests/test_integration.py
Unit tests mock requests at the module level, so this runs fully offline. tests/test_integration.py hits the live network and is excluded on purpose.
Note: this repository has no CI. Run that command yourself before opening the PR — nothing will run it for you.
Done when
A share link resolves to its canonical post and returns the author; the unit test covers both the redirect and the JSON parsing; README row added.
Out of scope
Comment authors, user profiles, anything needing Reddit API credentials.
Users report that Reddit share links of the form
https://www.reddit.com/r/<subreddit>/s/<token>are not handled.These 302-redirect to the canonical post. Follow the redirect, then read the resolved post's
comments.jsonto get the author.Extracts: post author username, subreddit, canonical post URL, post title.
Where the code goes
sharetrace/modules/reddit.py— one function, returns{"data": {...}}or{"error": "..."}.router.py: URL pattern plus an entry inPARSERS.output.py.tests/test_unit_modules.py— copy the shape ofTestTelegram. Mock both the redirect and the JSON response.README.md.How you verify it — no credentials, no network
Unit tests mock
requestsat the module level, so this runs fully offline.tests/test_integration.pyhits the live network and is excluded on purpose.Note: this repository has no CI. Run that command yourself before opening the PR — nothing will run it for you.
Done when
A share link resolves to its canonical post and returns the author; the unit test covers both the redirect and the JSON parsing; README row added.
Out of scope
Comment authors, user profiles, anything needing Reddit API credentials.