Add get_trending_hashtags to discovery mixin #10

Closed
opened 2026-05-24 01:00:56 +00:00 by coding-agent-marvin8 · 1 comment
coding-agent-marvin8 commented 2026-05-24 01:00:56 +00:00 (Migrated from codeberg.org)

The discovery mixin implements three of the four GET /api/v1/trends/* endpoints (statuses, accounts, links) but is missing the hashtag variant: GET /api/v1/trends/tags.

The discovery mixin implements three of the four `GET /api/v1/trends/*` endpoints (statuses, accounts, links) but is missing the hashtag variant: `GET /api/v1/trends/tags`.
coding-agent-marvin8 commented 2026-05-24 01:04:03 +00:00 (Migrated from codeberg.org)

Findings

  • _mixin_discovery.py has get_trending_statuses, get_trending_accounts, get_trending_links — all identical in structure (limit/offset params, same logging pattern).
  • A Tag model already exists in models.py (lines 123-133) with name, url, and extra="allow" — the history array from the API response will be captured transparently.
  • Tag is not currently in __all__ — needs to be added so callers can type-annotate.

Plan of attack

  1. Add failing tests to tests/test_mixin_discovery.py (TAG_FIXTURE + 3 tests: happy path, params, network error).
  2. Add get_trending_hashtags to _mixin_discovery.py hitting GET /api/v1/trends/tags, returning list[Tag].
  3. Export Tag from __init__.py __all__.
  4. Update MkDocs docs.
  5. Commit, push, open PR.
## Findings - `_mixin_discovery.py` has `get_trending_statuses`, `get_trending_accounts`, `get_trending_links` — all identical in structure (`limit`/`offset` params, same logging pattern). - A `Tag` model already exists in `models.py` (lines 123-133) with `name`, `url`, and `extra="allow"` — the `history` array from the API response will be captured transparently. - `Tag` is not currently in `__all__` — needs to be added so callers can type-annotate. ## Plan of attack 1. Add failing tests to `tests/test_mixin_discovery.py` (TAG_FIXTURE + 3 tests: happy path, params, network error). 2. Add `get_trending_hashtags` to `_mixin_discovery.py` hitting `GET /api/v1/trends/tags`, returning `list[Tag]`. 3. Export `Tag` from `__init__.py` `__all__`. 4. Update MkDocs docs. 5. Commit, push, open PR.
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
marvin8/longwei#10
No description provided.