Modules@robinpath/twitter

@robinpath/twitter

0.1.0Public

Twitter/X module for RobinPath.

@robinpath/twitter

Twitter/X module for RobinPath.

Category Functions Auth License

Why use this module?

The twitter module lets you:

  • Create a new tweet
  • Delete a tweet by ID
  • Get a single tweet by ID with optional expansions and fields
  • Get multiple tweets by IDs
  • Get tweets from a user's timeline

All functions are callable directly from RobinPath scripts with a simple, consistent API.

Installation

npm install @robinpath/twitter

Quick Start

1. Set up credentials

twitter.setToken "AAAA...your-bearer-token"

2. Create a new tweet

twitter.createTweet "Hello from RobinPath!"

Available Functions

FunctionDescription
twitter.setTokenStore a Bearer token for X/Twitter API v2 authentication
twitter.createTweetCreate a new tweet
twitter.deleteTweetDelete a tweet by ID
twitter.getTweetGet a single tweet by ID with optional expansions and fields
twitter.getTweetsGet multiple tweets by IDs
twitter.getUserTimelineGet tweets from a user's timeline
twitter.getMentionsGet tweets mentioning a user
twitter.searchRecentSearch recent tweets (last 7 days) with a query
twitter.getUserGet a user by username
twitter.getUserByIdGet a user by their ID
twitter.getMeGet the authenticated user's profile
twitter.getFollowersGet followers of a user
twitter.getFollowingGet users that a user is following
twitter.followFollow a user (uses authenticated user as source)
twitter.unfollowUnfollow a user
twitter.likeLike a tweet (uses authenticated user)
twitter.unlikeUnlike a tweet (uses authenticated user)
twitter.getLikedTweetsGet tweets liked by a user
twitter.retweetRetweet a tweet (uses authenticated user)
twitter.unretweetUndo a retweet (uses authenticated user)
twitter.getRetweetersGet users who retweeted a tweet
twitter.bookmarkBookmark a tweet (uses authenticated user)
twitter.removeBookmarkRemove a bookmarked tweet (uses authenticated user)
twitter.getBookmarksGet the authenticated user's bookmarked tweets
twitter.createListCreate a new list
twitter.deleteListDelete a list
twitter.addListMemberAdd a user to a list
twitter.removeListMemberRemove a user from a list
twitter.getListTweetsGet tweets from a list
twitter.sendDmSend a direct message to a user
twitter.getDmEventsGet direct message events

Examples

Create a new tweet

twitter.createTweet "Hello from RobinPath!"

Delete a tweet by ID

twitter.deleteTweet "1234567890"

Get a single tweet by ID with optional expansions and fields

twitter.getTweet "1234567890" {"tweet.fields": "created_at,public_metrics"}

Integration with RobinPath

import { RobinPath } from "@wiredwp/robinpath";
import Module from "@robinpath/twitter";

const rp = new RobinPath();
rp.registerModule(Module.name, Module.functions);
rp.registerModuleMeta(Module.name, Module.functionMetadata);

const result = await rp.executeScript(`
  twitter.setToken "AAAA...your-bearer-token"
  twitter.createTweet "Hello from RobinPath!"
`);

Full API Reference

See MODULE.md for complete documentation including all parameters, return types, error handling, and advanced examples.

Related Modules

License

MIT

Versions (1)

VersionTagPublished
0.1.0latestyesterday
Install
$ robinpath install @robinpath/twitter
Version0.1.0
LicenseMIT
Unpacked Size8.8 KB
Versions1
Weekly Downloads0
Total Downloads0
Stars0
Last Publishyesterday
Createdyesterday

Category

marketing