x-helper

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

X-Helper Skill

X-Helper Skill

  • Queries public Twitter data via free APIs (no API key needed)
  • Used to evaluate counterparty influence during XQuoteDeal negotiation
  • Pure function library in
    scripts/x_helper.py
    , invoked via
    python3 -c
  • 通过免费API查询公开Twitter数据(无需API密钥)
  • 用于在XQuoteDeal谈判期间评估对方影响力
  • scripts/x_helper.py
    中的纯函数库,可通过
    python3 -c
    调用

Functions

函数

x_helper.py

x_helper.py

  • lookup(username)
    ->
    {"username", "followers", "following", "tweets", "likes", "description"}
    • username
      : Twitter username (without @)
  • get_tweet(tweet_id, username="i")
    ->
    {"tweet_id", "username", "text", "likes", "retweets", "replies", "quote": {...} | None}
    • tweet_id
      : tweet ID
    • quote
      : nested object
      {"tweet_id", "username", "text"}
      if this tweet quotes another, else None
  • has_quoted(username, target_tweet_id, quote_tweet_id)
    ->
    {"username", "target_tweet_id", "quoted": bool, "quote_tweet_id": str | None}
    • username
      : expected quote author (without @)
    • target_tweet_id
      : the tweet that should be quoted
    • quote_tweet_id
      : the tweet claimed to be the quote
  • lookup(username)
    ->
    {"username", "followers", "following", "tweets", "likes", "description"}
    • username
      :Twitter用户名(不含@)
  • get_tweet(tweet_id, username="i")
    ->
    {"tweet_id", "username", "text", "likes", "retweets", "replies", "quote": {...} | None}
    • tweet_id
      :推文ID
    • quote
      :如果该推文引用了其他推文,则为嵌套对象
      {"tweet_id", "username", "text"}
      ,否则为None
  • has_quoted(username, target_tweet_id, quote_tweet_id)
    ->
    {"username", "target_tweet_id", "quoted": bool, "quote_tweet_id": str | None}
    • username
      :预期的引用者用户名(不含@)
    • target_tweet_id
      :被引用的目标推文ID
    • quote_tweet_id
      :声称是引用内容的推文ID

Limitations

局限性

  • No timeline endpoint available — cannot list a user's recent tweets
  • engagement_rate
    calculation not supported (requires recent tweet list)
  • has_quoted
    requires the caller to supply the
    quote_tweet_id
    (cannot scan timeline)
  • 无时间线端点——无法列出用户的近期推文
  • 不支持
    engagement_rate
    计算(需要近期推文列表)
  • has_quoted
    要求调用者提供
    quote_tweet_id
    (无法扫描时间线)

Examples

示例

bash
cd <path-to-this-skill>/scripts && python3 -c "
from x_helper import lookup
print(lookup('elonmusk'))
"
bash
cd <path-to-this-skill>/scripts && python3 -c "
from x_helper import get_tweet
print(get_tweet('20'))
"
bash
cd <path-to-this-skill>/scripts && python3 -c "
from x_helper import has_quoted
print(has_quoted('somequoter', '1234567890', '9876543210'))
"
bash
cd <path-to-this-skill>/scripts && python3 -c "
from x_helper import lookup
print(lookup('elonmusk'))
"
bash
cd <path-to-this-skill>/scripts && python3 -c "
from x_helper import get_tweet
print(get_tweet('20'))
"
bash
cd <path-to-this-skill>/scripts && python3 -c "
from x_helper import has_quoted
print(has_quoted('somequoter', '1234567890', '9876543210'))
"

Rules

规则

  1. Parse
    $ARGUMENTS
    and call
    lookup(username)
    .
  2. Respond in the user's language.
  3. Usernames must be real values — never fabricate or use mock data.
  1. 解析
    $ARGUMENTS
    并调用
    lookup(username)
  2. 以用户的语言回复。
  3. 用户名必须为真实值——切勿编造或使用模拟数据。