26 lines
653 B
TypeScript
Executable File
26 lines
653 B
TypeScript
Executable File
#!/usr/bin/env runts -- --allow-import --allow-net
|
|
|
|
import {
|
|
log,
|
|
} from "https://global.hatter.ink/script/get/@1/deno-commons-mod.ts";
|
|
|
|
const args = Deno.args;
|
|
|
|
if (args.length === 0) {
|
|
log.info(`ip.ts <IP Address>`);
|
|
Deno.exit(1);
|
|
}
|
|
|
|
const response = await fetch('https://ip2asn.hatter.ink/v1/as/ip/' + args[0], {
|
|
headers: {
|
|
"Accept": "application/json",
|
|
},
|
|
});
|
|
|
|
const response_json = await response.json();
|
|
|
|
console.log(JSON.stringify(response_json, null, 2));
|
|
|
|
// @SCRIPT-SIGNATURE-V1: yk-r1.ES256.20250621T102827+08:00.MEUCIH8GzRWo5xszTVRLgnj0
|
|
// G1NFdOP1S6AppVwTaZOIKRBvAiEAuQHAkkR8qqypkPyef82YmxDlgqe+/IFijBdcPzU5WtQ=
|