X

my-tweets

x.com
InstallationInstalls just this skill for your agent
Side effectread
Authsession
Needsnavigate · evaluate
Summary

Return the handle and recent tweets of the LOGGED-IN account on X, without asking for the handle.

Params
{}
Returns
{"tweets":"array of { id, url, text, time, isRetweet }","userId":"string","screen_name":"string"}
SKILL.md36 lines

Intent

Return the handle and recent tweets of the LOGGED-IN account on X, without asking for the handle. Reads the user-id from the twid cookie (format u=<id>), and calls UserTweets(userId) via API (no anti-bot signature). No params. Returns { userId, screen_name, tweets:[{id,url,text,time,isRetweet}] } (only originals and flagged RTs). Useful to operate on your own account (e.g. reply to yourself, or know who I am). Requires an X session. queryId UserTweets rotates per deploy; if it breaks, recapture.

Preconditions

  • Logged-in session in the browser you drive (X session started (x.com cookies, incl. ct0 and twid)).
  • If not logged in: navigate to https://x.com and let the user log in, then retry.

Execute

  1. navigate → https://x.com/home
  2. evaluate the Extractor below with params. It does the in-page work and returns the JSON in returns.

Extractor

( async (root, params) => { const ct0=(document.cookie.match(/ct0=([^;]+)/)||[])[1]||''; const twid=(document.cookie.match(/twid=([^;]+)/)||[])[1]||''; const uid=(decodeURIComponent(twid).match(/u=(\d+)/)||[])[1]; if(!uid) return { error:'could not read twid/userId' }; const BEARER='Bearer AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs=1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA'; const H={authorization:BEARER,'x-csrf-token':ct0,'x-twitter-active-user':'yes','x-twitter-auth-type':'OAuth2Session','x-twitter-client-language':'en','content-type':'application/json'}; const enc=encodeURIComponent; const twFeat={rweb_video_screen_enabled:false,rweb_cashtags_enabled:true,profile_label_improvements_pcf_label_in_post_enabled:true,responsive_web_profile_redirect_enabled:false,rweb_tipjar_consumption_enabled:false,verified_phone_label_enabled:false,creator_subscriptions_tweet_preview_api_enabled:true,responsive_web_graphql_timeline_navigation_enabled:true,responsive_web_graphql_skip_user_profile_image_extensions_enabled:false,premium_content_api_read_enabled:false,communities_web_enable_tweet_community_results_fetch:true,c9s_tweet_anatomy_moderator_badge_enabled:true,responsive_web_grok_analyze_button_fetch_trends_enabled:false,responsive_web_grok_analyze_post_followups_enabled:true,rweb_cashtags_composer_attachment_enabled:true,responsive_web_jetfuel_frame:true,responsive_web_grok_share_attachment_enabled:true,responsive_web_grok_annotations_enabled:true,articles_preview_enabled:true,responsive_web_edit_tweet_api_enabled:true,rweb_conversational_replies_downvote_enabled:false,graphql_is_translatable_rweb_tweet_is_translatable_enabled:true,view_counts_everywhere_api_enabled:true,longform_notetweets_consumption_enabled:true,responsive_web_twitter_article_tweet_consumption_enabled:true,content_disclosure_indicator_enabled:true,content_disclosure_ai_generated_indicator_enabled:true,responsive_web_grok_show_grok_translated_post:true,responsive_web_grok_analysis_button_from_backend:true,post_ctas_fetch_enabled:false,freedom_of_speech_not_reach_fetch_enabled:true,standardized_nudges_misinfo:true,tweet_with_visibility_results_prefer_gql_limited_actions_policy_enabled:true,longform_notetweets_rich_text_read_enabled:true,longform_notetweets_inline_media_enabled:false,responsive_web_grok_image_annotation_enabled:true,responsive_web_grok_imagine_annotation_enabled:true,responsive_web_grok_community_note_auto_translation_is_enabled:true,responsive_web_enhance_cards_enabled:false}; let d; try{ const r=await fetch('/i/api/graphql/RyDU3I9VJtPF-Pnl6vrRlw/UserTweets?variables='+enc(JSON.stringify({userId:uid,count:20,includePromotedContent:false,withQuickPromoteEligibilityTweetFields:false,withVoice:true}))+'&features='+enc(JSON.stringify(twFeat))+'&fieldToggles='+enc(JSON.stringify({withArticlePlainText:false})),{headers:H,credentials:'include'}); d=await r.json(); }catch(e){ return { userId:uid, error:'UserTweets fail: '+String(e) }; } let screen_name=null; const tweets=[]; const seen=new Set(); const walk=o=>{ if(!o||typeof o!=='object')return; if(o.__typename==='Tweet'&&o.legacy){ const lg=o.legacy; const id=lg.id_str||o.rest_id; try{ if(!screen_name) screen_name=o.core.user_results.result.core.screen_name; }catch(e){} if(id && !seen.has(id)){ seen.add(id); tweets.push({ id, url:'https://x.com/i/status/'+id, text:(lg.full_text||'').slice(0,200), time:lg.created_at, isRetweet: /^RT @/.test(lg.full_text||'') }); } } for(const k in o) walk(o[k]); }; walk(d); return { userId:uid, screen_name, tweets }; } )

Success assertion

{
  "expr": "#react-root",
  "type": "dom"
}
my-tweets: a X skill for AI browsing agents · browser-memory