Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Read-only Twitter/X data: search tweets, user profiles, followers, replies, and retweets via twitterapi.io.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
__init__.py
1"""2Twitter/X Extension — Read-only data via twitterapi.io34Provides 13 tools for Twitter/X data:5- twitter_search_tweets: Advanced tweet search6- twitter_get_tweets: Get tweets by ID7- twitter_get_article: Get long-form article by tweet ID8- twitter_tweet_thread_context: Get complete thread context9- twitter_tweet_quote: Get quote tweets for a tweet10- twitter_get_trends: Get trends11- twitter_user_info: User profile lookup12- twitter_user_tweets: User's recent tweets13- twitter_user_followers: User's followers14- twitter_user_followings: User's followings15- twitter_tweet_replies: Replies to a tweet16- twitter_tweet_retweeters: Users who retweeted17- twitter_search_users: Search for users1819Environment Variables:20- TWITTER_API_KEY: API key for twitterapi.io (required)2122Usage:23This extension is auto-loaded by the ExtensionLoader.24"""2526import logging27from typing import List2829logger = logging.getLogger(__name__)303132def register(api) -> List[str]:33"""34Extension entry point — register all Twitter tools.3536Args:37api: ExtensionApi instance with registry and config3839Returns:40List of registered tool names41"""42registered = []4344try:45from .tools import (46TwitterSearchTweetsTool,47TwitterGetTweetsTool,48TwitterGetArticleTool,49TwitterTweetThreadContextTool,50TwitterTweetQuoteTool,51TwitterGetTrendsTool,52TwitterUserInfoTool,53TwitterUserTweetsTool,54TwitterUserFollowersTool,55TwitterUserFollowingsTool,56TwitterTweetRepliesTool,57TwitterTweetRetweetersTool,58TwitterSearchUsersTool,59)6061api.register_tool(TwitterSearchTweetsTool())62api.register_tool(TwitterGetTweetsTool())63api.register_tool(TwitterGetArticleTool())64api.register_tool(TwitterTweetThreadContextTool())65api.register_tool(TwitterTweetQuoteTool())66api.register_tool(TwitterGetTrendsTool())67api.register_tool(TwitterUserInfoTool())68api.register_tool(TwitterUserTweetsTool())69api.register_tool(TwitterUserFollowersTool())70api.register_tool(TwitterUserFollowingsTool())71api.register_tool(TwitterTweetRepliesTool())72api.register_tool(TwitterTweetRetweetersTool())73api.register_tool(TwitterSearchUsersTool())7475registered = [76"twitter_search_tweets",77"twitter_get_tweets",78"twitter_get_article",79"twitter_tweet_thread_context",80"twitter_tweet_quote",81"twitter_get_trends",82"twitter_user_info",83"twitter_user_tweets",84"twitter_user_followers",85"twitter_user_followings",86"twitter_tweet_replies",87"twitter_tweet_retweeters",88"twitter_search_users",89]9091logger.info(f"Registered Twitter tools ({len(registered)} tools)")92except Exception as e:93logger.warning(f"Failed to load Twitter tools: {e}")9495return registered969798# Extension metadata99EXTENSION_INFO = {100"name": "twitter",101"version": "1.1.0",102"description": "Twitter/X data — search tweets, article, thread context, quote tweets, trends, users",103"tools": [104"twitter_search_tweets",105"twitter_get_tweets",106"twitter_get_article",107"twitter_tweet_thread_context",108"twitter_tweet_quote",109"twitter_get_trends",110"twitter_user_info",111"twitter_user_tweets",112"twitter_user_followers",113"twitter_user_followings",114"twitter_tweet_replies",115"twitter_tweet_retweeters",116"twitter_search_users",117],118"env_vars": [119"TWITTER_API_KEY",120],121}122