/*** [task_local] event-interaction https://raw.githubusercontent.com/KOP-XIAO/QuantumultX/master/Scripts/geo_location.js, tag=GeoIP 查询, img-url=location.fill.viewfinder.system @XIAO_KOP **/ var url = "https://api.ip.sb/geoip" var opts = { policy: $environment.params }; var myRequest = { url: url, opts: opts, timeout: 4000 }; var message = "" const paras = ["ip","isp","country_code","city"] const paran = ["IP","ISP","地区","城市"] $task.fetch(myRequest).then(response => { message = response? json2info(response.body,paras) : "" $done({"title": " 🔎 IP.SB 查询结果", "message": message}); }, reason => { message = "\n\n🛑 查询超时" $done({"title": "🔎 IP.SB 查询结果", "message": message}); }) function json2info(cnt,paras) { var res = "\n" cnt =JSON.parse(cnt) for (i=0;i