X

find-queryid

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

Find the queryId of an X GraphQL operation by searching the loaded JS bundles.

Params
{"op":"string (operationName)"}
Returns
{"op":"string","queryId":"string|null"}
SKILL.md28 lines

Intent

Find the queryId of an X GraphQL operation by searching the loaded JS bundles. PARAM: op (operation name, e.g. 'CreateTweet'). Scans the abs.twimg.com scripts and matches the queryId/operationName pattern. Returns { op, queryId }. Useful to build/recapture X tools when the hashes rotate. Requires being on x.com.

Preconditions

  • Logged-in session in the browser you drive (X session / being on x.com).
  • 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 op = String((params&&params.op)||'').trim(); if(!op) return { error:'missing op' }; const scripts=[...new Set(Array.from(document.querySelectorAll('script[src]')).map(s=>s.src).filter(s=>/abs.twimg.com/.test(s)))]; let qid=null, scanned=0; for(const u of scripts){ if(qid) break; try{ const r=await fetch(u); const t=await r.text(); scanned++; const re=new RegExp('queryId:"([^"]+)",operationName:"'+op+'"'); let m=t.match(re); if(!m){ const re2=new RegExp('operationName:"'+op+'"[^}]{0,60}?queryId:"([^"]+)"'); m=t.match(re2); } if(!m){ const re3=new RegExp('"'+op+'"[\s\S]{0,160}?queryId:"([^"]+)"'); m=t.match(re3); } if(m) qid=m[1]; }catch(e){} } return { op, queryId:qid, scriptsScanned:scanned, totalScripts:scripts.length }; } )

Success assertion

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