Install
openclaw skills install @hardbrick21/omni-xExtract X (Twitter) data including user profiles, posts, followers, followings, media, and search results. This skill provides comprehensive Twitter data extraction capabilities using the tweeterpy library. Trigger scenarios: When user asks to get Twitter user information or profile When user wants to extract tweets from a specific user When user needs to analyze Twitter followers or followings When user wants to search for tweets by keywords When user needs to extract media from Twitter posts Authentication levels: Guest session (no auth): get_user_profile, get_user_tweets Authenticated session (auth_token required): get_user_followers, get_user_followings, get_user_media, search_tweets
openclaw skills install @hardbrick21/omni-xThis skill provides AI agents with the ability to extract various types of data from X (Twitter) platform, including user profiles, posts, followers, followings, media content, and search results.
references/INSTALLATION.md)from scripts import TwitterSkillInterface
# Method 1: Initialize with auth_token (RECOMMENDED for full access)
interface = TwitterSkillInterface(auth_token="your_auth_token_here")
# Method 2: Initialize without token (guest session - limited features)
interface = TwitterSkillInterface()
# Method 3: Set token after initialization
interface = TwitterSkillInterface()
interface.set_auth_token("your_auth_token_here")
# Get all available skills and their metadata
skills = interface.get_available_skills()
# Each skill contains:
# - description: What the skill does
# - parameters: Required and optional parameters
# - returns: Expected return format
# - requires_auth: Whether authentication is needed
# Execute a skill with parameters
result = interface.execute_skill(
skill_name="get_user_tweets",
parameters={"username": "elonmusk", "count": 10}
)
# Check result
if result["success"]:
data = result["data"]
print(f"Retrieved {result['count']} items")
else:
print(f"Error: {result['error']}")
All skills return a standardized response format:
Success Response:
{
"success": True,
"data": [...], # The actual data
"count": 10, # Number of items (if applicable)
"has_next_page": True, # Pagination info (if applicable)
"cursor": "...", # Cursor for next page (if applicable)
"skill_name": "...", # Name of executed skill
"parameters": {...} # Parameters used
}
Error Response:
{
"success": False,
"error": "Error message",
"skill_name": "...",
"parameters": {...}
}
Description: Extract detailed user profile information.
Authentication: Not required (works with guest session)
Parameters:
username (str, required): Twitter username without @ symbolExample:
result = interface.execute_skill(
skill_name="get_user_profile",
parameters={"username": "elonmusk"}
)
Returns: User profile data including name, bio, followers count, following count, etc.
Description: Extract recent tweets from a specific user.
Authentication: Not required (works with guest session)
Parameters:
username (str, required): Twitter username without @ symbolcount (int, optional): Number of tweets to retrieve (default: 10)Example:
result = interface.execute_skill(
skill_name="get_user_tweets",
parameters={"username": "elonmusk", "count": 20}
)
Returns: List of tweets with text, timestamp, engagement metrics, etc.
Description: Extract list of users following the specified account.
Authentication: Required (auth_token needed)
Parameters:
username (str, required): Twitter username without @ symbolcount (int, optional): Number of followers to retrieve (default: 20)Example:
result = interface.execute_skill(
skill_name="get_user_followers",
parameters={"username": "elonmusk", "count": 50}
)
Returns: List of follower profiles with pagination support.
Description: Extract list of users that the specified account follows.
Authentication: Required (auth_token needed)
Parameters:
username (str, required): Twitter username without @ symbolcount (int, optional): Number of followings to retrieve (default: 20)Example:
result = interface.execute_skill(
skill_name="get_user_followings",
parameters={"username": "elonmusk", "count": 50}
)
Returns: List of following profiles with pagination support.
Description: Extract media content (photos/videos) from user's tweets.
Authentication: Required (auth_token needed)
Parameters:
username (str, required): Twitter username without @ symbolcount (int, optional): Number of media items to retrieve (default: 10)Example:
result = interface.execute_skill(
skill_name="get_user_media",
parameters={"username": "elonmusk", "count": 15}
)
Returns: List of media items with URLs and metadata.
Description: Search for tweets matching a query string.
Authentication: Required (auth_token needed)
Parameters:
query (str, required): Search query stringcount (int, optional): Number of tweets to retrieve (default: 10)search_filter (str, optional): Filter type - "Latest", "Top", "People", "Photos", "Videos" (default: "Top")Example:
result = interface.execute_skill(
skill_name="search_tweets",
parameters={
"query": "AI technology",
"count": 20,
"search_filter": "Latest"
}
)
Returns: List of tweets matching the search query.
When using this skill, follow these steps:
Determine the task: Analyze user request to identify which skill is needed
get_user_profileget_user_tweetsget_user_followersget_user_followingsget_user_mediasearch_tweetsCheck authentication requirements:
get_user_profile, get_user_tweetsget_user_followers, get_user_followings, get_user_media, search_tweetsExtract parameters from user request:
Execute the skill:
result = interface.execute_skill(skill_name="...", parameters={...})
Process and present results:
result["success"] firstresult["data"]result["error"] to userresult["has_next_page"] is Trueresult = interface.execute_skill(skill_name="...", parameters={...})
if not result["success"]:
error_msg = result["error"]
# Common errors and solutions:
if "auth" in error_msg.lower() or "login" in error_msg.lower():
# Inform user that authentication is required
print("This feature requires authentication. Please provide auth_token.")
elif "not found" in error_msg.lower():
# Username doesn't exist
print(f"User not found. Please check the username.")
elif "rate limit" in error_msg.lower():
# Rate limit exceeded
print("Rate limit exceeded. Please wait before trying again.")
else:
# Generic error
print(f"An error occurred: {error_msg}")
from scripts import TwitterSkillInterface
# Initialize
interface = TwitterSkillInterface()
# Get profile
profile = interface.execute_skill(
skill_name="get_user_profile",
parameters={"username": "elonmusk"}
)
if profile["success"]:
print(f"User: {profile['data']['name']}")
print(f"Followers: {profile['data']['followers_count']}")
# Get recent tweets
tweets = interface.execute_skill(
skill_name="get_user_tweets",
parameters={"username": "elonmusk", "count": 5}
)
if tweets["success"]:
for tweet in tweets["data"]:
print(f"Tweet: {tweet['text']}")
from scripts import TwitterSkillInterface
# Initialize with auth token
interface = TwitterSkillInterface(auth_token="your_auth_token")
# Search for tweets
results = interface.execute_skill(
skill_name="search_tweets",
parameters={
"query": "artificial intelligence",
"count": 20,
"search_filter": "Latest"
}
)
if results["success"]:
print(f"Found {results['count']} tweets")
for tweet in results["data"]:
print(f"- {tweet['text'][:100]}...")
from scripts import TwitterSkillInterface
# Initialize with auth token
interface = TwitterSkillInterface(auth_token="your_auth_token")
username = "elonmusk"
# Get followers
followers = interface.execute_skill(
skill_name="get_user_followers",
parameters={"username": username, "count": 100}
)
# Get followings
followings = interface.execute_skill(
skill_name="get_user_followings",
parameters={"username": username, "count": 100}
)
if followers["success"] and followings["success"]:
print(f"Followers: {followers['count']}")
print(f"Following: {followings['count']}")
print(f"Ratio: {followers['count'] / followings['count']:.2f}")
result["success"] before accessing datacursor field for large datasetsSee references/LOGIN_GUIDE.md for detailed instructions on obtaining and using auth_token.
Quick steps:
auth_token cookieTwitterSkillInterface(auth_token="...")Problem: "Guest session has limited access"
Problem: "User not found"
Problem: "Rate limit exceeded"
Problem: "Authentication required"
references/AI_AGENT_GUIDE.mdreferences/LOGIN_GUIDE.mdreferences/INSTALLATION.mdagent_example.pyFor issues or questions, refer to the documentation in the references/ directory or check the main README.md file.