Skip to content

feat(twitter): add likes command#448

Merged
jackwener merged 3 commits intojackwener:mainfrom
hanxiao790:feat/twitter-likes
Mar 26, 2026
Merged

feat(twitter): add likes command#448
jackwener merged 3 commits intojackwener:mainfrom
hanxiao790:feat/twitter-likes

Conversation

@hanxiao790
Copy link
Copy Markdown
Contributor

Summary

Add a new likes command for Twitter that enables users to fetch liked tweets from any Twitter/X user profile. The command leverages the existing cookie-based
authentication strategy and Twitter's internal GraphQL API.

What's New

  • New command: opencli twitter likes [username] [--limit N]

    • Fetches liked tweets from a specified Twitter user
    • If no username is provided, defaults to the logged-in user's likes
    • Supports pagination to fetch up to the specified limit (default: 20)
  • Features:

    • Auto-detects logged-in user via profile link when username is omitted
    • Dynamically resolves GraphQL query IDs from the fa0311/twitter-openapi community source with fallback to hardcoded values
    • Deduplicates tweets across paginated responses
    • Outputs structured data: author, display name, tweet text, like count, and tweet URL

Test Plan

  • Run opencli twitter likes without arguments to verify it fetches the logged-in user's likes
  • Run opencli twitter likes <username> to fetch another user's likes
  • Run opencli twitter likes <username> --limit 50 to verify pagination works correctly
  • Verify output includes all expected columns (author, name, text, likes, url)
  • Test error handling when not logged in (should show auth required error)
  • Test error handling for invalid/non-existent username

@jackwener jackwener force-pushed the feat/twitter-likes branch from 9f16672 to fca62e4 Compare March 26, 2026 04:32
@jackwener jackwener merged commit 7348231 into jackwener:main Mar 26, 2026
jackwener added a commit to Xeron2000/opencli that referenced this pull request Mar 26, 2026
* feat(twitter): add likes command

* review: harden twitter likes query resolution

* refactor(twitter): share query id resolution

---------

Co-authored-by: jackwener <jakevingoo@gmail.com>
@jackwener jackwener mentioned this pull request Mar 26, 2026
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.

2 participants