MCPcopy Create free account
hub / github.com/Useful-Scripts-Extension/useful-script / _getFollow

Function _getFollow

scripts/insta_GLOBAL.js:101–121  ·  view source on GitHub ↗
(uid, end_cursor)

Source from the content-addressed store, hash-verified

99 if (!(type in CACHED)) throw Error(`Invalid type: ${type}`);
100
101 async function _getFollow(uid, end_cursor) {
102 let url = new URL("https://www.instagram.com/graphql/query/");
103 Object.entries({
104 query_hash: CACHED[type].hash,
105 variables: JSON.stringify({
106 id: uid,
107 after: end_cursor || "",
108 first: 50,
109 }),
110 }).forEach(([k, v]) => url.searchParams.append(k, v));
111
112 let res = await fetch(url, {
113 headers: {
114 "Content-Type": "application/x-www-form-urlencoded",
115 "X-CSRFToken": csrftoken,
116 "x-requested-with": "XMLHttpRequest",
117 "x-instagram-ajax": 1,
118 },
119 });
120 return await res.json();
121 }
122
123 let cursor = "";
124 let total = 0;

Callers 1

getAllFollowFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected