MCPcopy Create free account
hub / github.com/TeleBoxOrg/TeleBox_Plugins / getIpApi

Function getIpApi

speedlink/speedlink.ts:363–380  ·  view source on GitHub ↗
(ip: string)

Source from the content-addressed store, hash-verified

361 const asInfo = data.as?.split(" ")[0] || "";
362 const ccFlag = data.countryCode
363 ? String.fromCodePoint(
364 ...data.countryCode
365 .toUpperCase()
366 .split("")
367 .map((c: string) => 127397 + c.charCodeAt(0))
368 )
369 : "";
370 return { asInfo, ccFlag };
371 } catch (error: any) {
372 return { asInfo: "", ccFlag: "" };
373 }
374}
375
376async function saveSpeedtestImage(url: string): Promise<string | null> {
377 try {
378 const imageUrl = url + ".png";
379 const response = await axios.get(imageUrl, { responseType: "arraybuffer" });
380 const imagePath = path.join(TEMP_DIR, "speedtest.png");
381 const filledImagePath = path.join(TEMP_DIR, "speedtest_filled.png");
382 fs.writeFileSync(imagePath, response.data);
383

Callers 1

speedtestFunction · 0.70

Calls 1

getMethod · 0.45

Tested by

no test coverage detected