docs: rename rt/unrt → retweet/unretweet, update SKILL.md + README.md
- Rename rt/unrt commands to retweet/unretweet for clarity - SKILL.md: fix Python version, add --output/--filter examples, safety notes - README.md: dynamic Chrome fingerprint, write delays, --output examples - Sync Chinese section with English changes
This commit is contained in:
14
README.md
14
README.md
@@ -37,9 +37,10 @@ A terminal-first CLI for Twitter/X: read timelines, bookmarks, and user profiles
|
|||||||
**Auth & Anti-Detection:**
|
**Auth & Anti-Detection:**
|
||||||
- Cookie auth: use browser cookies or environment variables
|
- Cookie auth: use browser cookies or environment variables
|
||||||
- Full cookie forwarding: extracts ALL browser cookies for true browser fingerprint
|
- Full cookie forwarding: extracts ALL browser cookies for true browser fingerprint
|
||||||
- TLS fingerprint impersonation: `curl_cffi` with Chrome 133 JA3/HTTP2
|
- TLS fingerprint impersonation: `curl_cffi` with dynamic Chrome version matching
|
||||||
- `x-client-transaction-id` header generation
|
- `x-client-transaction-id` header generation
|
||||||
- Request timing jitter to avoid pattern detection
|
- Request timing jitter to avoid pattern detection
|
||||||
|
- Write operation delays (1.5–4s random) to mitigate rate limits
|
||||||
- Proxy support via `TWITTER_PROXY` environment variable
|
- Proxy support via `TWITTER_PROXY` environment variable
|
||||||
|
|
||||||
### Installation
|
### Installation
|
||||||
@@ -89,6 +90,8 @@ twitter favorites --max 30 --json
|
|||||||
twitter search "Claude Code"
|
twitter search "Claude Code"
|
||||||
twitter search "AI agent" -t Latest --max 50
|
twitter search "AI agent" -t Latest --max 50
|
||||||
twitter search "机器学习" --json
|
twitter search "机器学习" --json
|
||||||
|
twitter search "topic" -o results.json # Save to file
|
||||||
|
twitter search "trending" --filter # Apply ranking filter
|
||||||
|
|
||||||
# Tweet detail (view tweet + replies)
|
# Tweet detail (view tweet + replies)
|
||||||
twitter tweet 1234567890
|
twitter tweet 1234567890
|
||||||
@@ -100,7 +103,9 @@ twitter list 1539453138322673664
|
|||||||
# User
|
# User
|
||||||
twitter user elonmusk
|
twitter user elonmusk
|
||||||
twitter user-posts elonmusk --max 20
|
twitter user-posts elonmusk --max 20
|
||||||
|
twitter user-posts elonmusk -o tweets.json
|
||||||
twitter likes elonmusk --max 30
|
twitter likes elonmusk --max 30
|
||||||
|
twitter likes elonmusk -o likes.json
|
||||||
twitter followers elonmusk --max 50
|
twitter followers elonmusk --max 50
|
||||||
twitter following elonmusk --max 50
|
twitter following elonmusk --max 50
|
||||||
|
|
||||||
@@ -290,9 +295,10 @@ After installation, OpenClaw can call `twitter-cli` commands directly.
|
|||||||
**认证与反风控:**
|
**认证与反风控:**
|
||||||
- Cookie 认证:支持环境变量和浏览器自动提取
|
- Cookie 认证:支持环境变量和浏览器自动提取
|
||||||
- 完整 Cookie 转发:提取浏览器中所有 Twitter Cookie
|
- 完整 Cookie 转发:提取浏览器中所有 Twitter Cookie
|
||||||
- TLS 指纹伪装:`curl_cffi` Chrome 133 JA3/HTTP2
|
- TLS 指纹伪装:`curl_cffi` 动态匹配 Chrome 版本
|
||||||
- `x-client-transaction-id` 请求头生成
|
- `x-client-transaction-id` 请求头生成
|
||||||
- 请求时序随机化(jitter)
|
- 请求时序随机化(jitter)
|
||||||
|
- 写操作随机延迟(1.5–4 秒),降低频率风控
|
||||||
- 代理支持:`TWITTER_PROXY` 环境变量
|
- 代理支持:`TWITTER_PROXY` 环境变量
|
||||||
|
|
||||||
### 安装
|
### 安装
|
||||||
@@ -316,6 +322,8 @@ twitter favorites
|
|||||||
# 搜索
|
# 搜索
|
||||||
twitter search "Claude Code"
|
twitter search "Claude Code"
|
||||||
twitter search "AI agent" -t Latest --max 50
|
twitter search "AI agent" -t Latest --max 50
|
||||||
|
twitter search "topic" -o results.json # 保存到文件
|
||||||
|
twitter search "trending" --filter # 启用排序筛选
|
||||||
|
|
||||||
# 推文详情
|
# 推文详情
|
||||||
twitter tweet 1234567890
|
twitter tweet 1234567890
|
||||||
@@ -326,7 +334,9 @@ twitter list 1539453138322673664
|
|||||||
# 用户
|
# 用户
|
||||||
twitter user elonmusk
|
twitter user elonmusk
|
||||||
twitter user-posts elonmusk --max 20
|
twitter user-posts elonmusk --max 20
|
||||||
|
twitter user-posts elonmusk -o tweets.json
|
||||||
twitter likes elonmusk --max 30
|
twitter likes elonmusk --max 30
|
||||||
|
twitter likes elonmusk -o likes.json
|
||||||
twitter followers elonmusk
|
twitter followers elonmusk
|
||||||
twitter following elonmusk
|
twitter following elonmusk
|
||||||
|
|
||||||
|
|||||||
10
SKILL.md
10
SKILL.md
@@ -18,7 +18,7 @@ Use this skill when the user wants to read or interact with Twitter/X content fr
|
|||||||
## Prerequisites
|
## Prerequisites
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Install (requires Python 3.10+)
|
# Install (requires Python 3.8+)
|
||||||
uv tool install twitter-cli
|
uv tool install twitter-cli
|
||||||
# Or: pipx install twitter-cli
|
# Or: pipx install twitter-cli
|
||||||
```
|
```
|
||||||
@@ -55,6 +55,8 @@ twitter favorites --filter # Apply ranking filter
|
|||||||
twitter search "keyword"
|
twitter search "keyword"
|
||||||
twitter search "AI agent" -t Latest --max 50
|
twitter search "AI agent" -t Latest --max 50
|
||||||
twitter search "机器学习" --json
|
twitter search "机器学习" --json
|
||||||
|
twitter search "topic" -o results.json # Save to file
|
||||||
|
twitter search "trending" --filter # Apply ranking filter
|
||||||
```
|
```
|
||||||
|
|
||||||
### Tweet Detail
|
### Tweet Detail
|
||||||
@@ -75,7 +77,9 @@ twitter list 1539453138322673664 # Fetch tweets from a Twitter List
|
|||||||
```bash
|
```bash
|
||||||
twitter user elonmusk # User profile
|
twitter user elonmusk # User profile
|
||||||
twitter user-posts elonmusk --max 20 # User's tweets
|
twitter user-posts elonmusk --max 20 # User's tweets
|
||||||
|
twitter user-posts elonmusk -o tweets.json # Save to file
|
||||||
twitter likes elonmusk --max 30 # User's likes
|
twitter likes elonmusk --max 30 # User's likes
|
||||||
|
twitter likes elonmusk -o likes.json # Save to file
|
||||||
twitter followers elonmusk --max 50 # User's followers
|
twitter followers elonmusk --max 50 # User's followers
|
||||||
twitter following elonmusk --max 50 # User's following
|
twitter following elonmusk --max 50 # User's following
|
||||||
```
|
```
|
||||||
@@ -101,6 +105,8 @@ twitter feed --json > tweets.json
|
|||||||
twitter feed --input tweets.json
|
twitter feed --input tweets.json
|
||||||
twitter user-posts elonmusk --json | jq '.[0].text'
|
twitter user-posts elonmusk --json | jq '.[0].text'
|
||||||
twitter search "keyword" --json | jq 'length'
|
twitter search "keyword" --json | jq 'length'
|
||||||
|
twitter search "topic" -o results.json
|
||||||
|
twitter likes elonmusk -o likes.json
|
||||||
```
|
```
|
||||||
|
|
||||||
## Ranking Filter
|
## Ranking Filter
|
||||||
@@ -149,6 +155,8 @@ twitter favorites --filter
|
|||||||
|
|
||||||
## Safety Notes
|
## Safety Notes
|
||||||
|
|
||||||
|
- Write operations have built-in random delays (1.5–4s) to avoid rate limits.
|
||||||
|
- TLS fingerprint and User-Agent are automatically matched to the Chrome version used.
|
||||||
- Do not ask users to share raw cookie values in chat logs.
|
- Do not ask users to share raw cookie values in chat logs.
|
||||||
- Prefer local browser cookie extraction over manual secret copy/paste.
|
- Prefer local browser cookie extraction over manual secret copy/paste.
|
||||||
- If auth fails with 401/403, ask the user to re-login to `x.com`.
|
- If auth fails with 401/403, ask the user to re-login to `x.com`.
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "twitter-cli"
|
name = "twitter-cli"
|
||||||
version = "0.4.4"
|
version = "0.4.5"
|
||||||
description = "A CLI for Twitter/X — feed, bookmarks, and user timeline in terminal"
|
description = "A CLI for Twitter/X — feed, bookmarks, and user timeline in terminal"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
license = "Apache-2.0"
|
license = "Apache-2.0"
|
||||||
|
|||||||
@@ -486,7 +486,7 @@ def unlike(tweet_id):
|
|||||||
|
|
||||||
@cli.command()
|
@cli.command()
|
||||||
@click.argument("tweet_id")
|
@click.argument("tweet_id")
|
||||||
def rt(tweet_id):
|
def retweet(tweet_id):
|
||||||
# type: (str,) -> None
|
# type: (str,) -> None
|
||||||
"""Retweet a tweet. TWEET_ID is the numeric tweet ID."""
|
"""Retweet a tweet. TWEET_ID is the numeric tweet ID."""
|
||||||
_write_action("🔄", "Retweeting", "retweet", tweet_id)
|
_write_action("🔄", "Retweeting", "retweet", tweet_id)
|
||||||
@@ -494,7 +494,7 @@ def rt(tweet_id):
|
|||||||
|
|
||||||
@cli.command()
|
@cli.command()
|
||||||
@click.argument("tweet_id")
|
@click.argument("tweet_id")
|
||||||
def unrt(tweet_id):
|
def unretweet(tweet_id):
|
||||||
# type: (str,) -> None
|
# type: (str,) -> None
|
||||||
"""Undo a retweet. TWEET_ID is the numeric tweet ID."""
|
"""Undo a retweet. TWEET_ID is the numeric tweet ID."""
|
||||||
_write_action("🔄", "Undoing retweet", "unretweet", tweet_id)
|
_write_action("🔄", "Undoing retweet", "unretweet", tweet_id)
|
||||||
|
|||||||
2
uv.lock
generated
2
uv.lock
generated
@@ -950,7 +950,7 @@ wheels = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "twitter-cli"
|
name = "twitter-cli"
|
||||||
version = "0.4.3"
|
version = "0.4.4"
|
||||||
source = { editable = "." }
|
source = { editable = "." }
|
||||||
dependencies = [
|
dependencies = [
|
||||||
{ name = "beautifulsoup4" },
|
{ name = "beautifulsoup4" },
|
||||||
|
|||||||
Reference in New Issue
Block a user