Composio Composer X Skill
This skill enables posting tweets to Twitter/X through Composio's integration platform. It uses HTTP requests with BeautifulSoup to interact with Composio's web interface, providing a post_tweet function that can be called from OpenClaw.
Installation
- 1. Install dependencies:
CODEBLOCK0
- 2. Configure credentials in
.env file or environment
- 3. Import and use the skill in your OpenClaw workflow
Tool Definitions
post_tweet
Posts a tweet to Twitter/X using Composio.
Function Signature:
CODEBLOCK1
Parameters:
- -
content (str): The tweet content (max 280 characters) - INLINECODE3 (str): The Composio authentication token for authorization
Returns:
-
success (bool): Whether the tweet was posted successfully
-
tweet_id (str): The posted tweet's ID (on success)
-
tweet_url (str): URL to view the tweet (on success)
-
error (str): Error message (on failure)
Example:
CODEBLOCK2
get_tweet
Retrieves a tweet by ID.
Function Signature:
CODEBLOCK3
Parameters:
- -
tweet_id (str): The tweet ID to retrieve - INLINECODE10 (str): The Composio authentication token
Returns:
- -
dict: Contains tweet data or error information
delete_tweet
Deletes a tweet.
Function Signature:
CODEBLOCK4
Parameters:
- -
tweet_id (str): The tweet ID to delete - INLINECODE13 (str): The Composio authentication token
Returns:
- -
dict: Contains success (bool) and status message
Configuration
The skill requires the following environment variables:
- -
COMPOSIO_CLIENT_ID: Your Composio client ID - INLINECODE17 : Your Composio API key
- INLINECODE18 : Your Composio session token
- INLINECODE19 : Your Composio bearer token
- INLINECODE20 : Your Composio user ID
Notes
- - This implementation uses HTTP requests to emulate Composio interaction
- Direct API access through OpenClaw is currently unavailable
- Rate limits apply per Twitter/X and Composio policies
- Session tokens expire after 7200 seconds (2 hours)
Composio Composer X 技能
该技能能够通过Composio的集成平台在Twitter/X上发布推文。它使用HTTP请求配合BeautifulSoup与Composio的Web界面交互,提供了一个可从OpenClaw调用的post_tweet函数。
安装
- 1. 安装依赖:
bash
pip install requests beautifulsoup4 python-dotenv
- 2. 在.env文件或环境中配置凭证
- 3. 在OpenClaw工作流中导入并使用该技能
工具定义
post_tweet
使用Composio在Twitter/X上发布推文。
函数签名:
python
def posttweet(content: str, composioauth_token: str) -> dict:
参数:
- - content (str):推文内容(最多280个字符)
- composioauthtoken (str):用于授权的Composio认证令牌
返回值:
- success (bool):推文是否发布成功
- tweet_id (str):已发布推文的ID(成功时)
- tweet_url (str):查看推文的URL(成功时)
- error (str):错误信息(失败时)
示例:
python
result = post_tweet(
content=来自OpenClaw的问候!🐾,
composioauthtoken=你的composioauthtoken在此
)
print(f推文已发布:{result.get(tweet_url)})
get_tweet
根据ID获取推文。
函数签名:
python
def gettweet(tweetid: str, composioauthtoken: str) -> dict:
参数:
- - tweetid (str):要获取的推文ID
- composioauth_token (str):Composio认证令牌
返回值:
delete_tweet
删除推文。
函数签名:
python
def deletetweet(tweetid: str, composioauthtoken: str) -> dict:
参数:
- - tweetid (str):要删除的推文ID
- composioauth_token (str):Composio认证令牌
返回值:
- - dict:包含success(布尔值)和状态信息
配置
该技能需要以下环境变量:
- - COMPOSIOCLIENTID:你的Composio客户端ID
- COMPOSIOAPIKEY:你的Composio API密钥
- COMPOSIOSESSIONTOKEN:你的Composio会话令牌
- COMPOSIOBEARERTOKEN:你的Composio承载令牌
- COMPOSIOUSERID:你的Composio用户ID
注意事项
- - 此实现使用HTTP请求模拟Composio交互
- 目前无法通过OpenClaw直接访问API
- 速率限制遵循Twitter/X和Composio的政策
- 会话令牌在7200秒(2小时)后过期