Find the queryId of an X GraphQL operation by searching the loaded JS bundles.
{"op":"string (operationName)"}{"op":"string","queryId":"string|null"}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.
params. It does the in-page work and returns the JSON in returns.( async (root, params) => { const op = String((params&¶ms.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 }; } )
{
"expr": "#react-root",
"type": "dom"
}