diff --git a/Scripts/UI-Action.json b/Scripts/UI-Action.json index 1625204..ad2c827 100644 --- a/Scripts/UI-Action.json +++ b/Scripts/UI-Action.json @@ -12,6 +12,7 @@ "event-interaction https://raw.githubusercontent.com/KOP-XIAO/QuantumultX/master/Scripts/switch-check-disneyplus.js, tag=Disneyᐩ 切换, img-url=https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/Disney.png, enabled=true", "event-interaction https://raw.githubusercontent.com/KOP-XIAO/QuantumultX/master/Scripts/switch-check-google.js, tag=Google 切换, img-url=https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/Google.png, enabled=true", "event-interaction https://raw.githubusercontent.com/KOP-XIAO/QuantumultX/master/Scripts/traffic-check.js, tag=策略流量查询, img-url=https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/Download.png, enabled=true", - "event-network network-direct.js, tag=Direct 策略切换, img-url=switch.2.system" + "event-network network-direct.js, tag=Direct 策略切换, img-url=switch.2.system", + "event-interaction https://raw.githubusercontent.com/KOP-XIAO/QuantumultX/master/Scripts/server-info-plus.js, tag=节点信息Plus, img-url=info.bubble.system.system" ] } \ No newline at end of file diff --git a/Scripts/server-info-plus.js b/Scripts/server-info-plus.js new file mode 100644 index 0000000..cf66af7 --- /dev/null +++ b/Scripts/server-info-plus.js @@ -0,0 +1,85 @@ + /*** + [task_local] + event-interaction https://raw.githubusercontent.com/KOP-XIAO/QuantumultX/master/Scripts/server-info-plus.js, tag=节点信息Plus, img-url=info.bubble.system.system + @XIAO_KOP + 2023-04-14 + **/ + +// var content= `
` + response.body + `
`; + +let base_url = "https://scamalytics.com/ip/" + + 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) : "" + let ip = JSON.parse(response.body)["ip"] + var myRequest1 = { + url: base_url+ip, + opts: opts, + timeout: 4000 + }; + $task.fetch(myRequest1).then(response => { + message = message + Display(response.body) + console.log("url: "+ base_url+ip+"\n\n"+message) + message = message+ "------------------------------"+""+""+"节点 ➟ " + $environment.params+ "" + message = `` + message + `
` + $done({"title": " 🔎 IP.SB 查询结果", "htmlMessage": message}); + }, reason => { + message = "🛑 查询超时" + message = `` + message + `
` + $done({"title": "🔎 IP.SB 查询结果", "htmlMessage": message}); + }) + }, reason => { + message = "🛑 查询超时" + message = `` + message + `
` + $done({"title": "🔎 IP.SB 查询结果", "htmlMessage": message}); + }) + +function json2info(cnt,paras) { + var res = "------------------------------" + cnt =JSON.parse(cnt) + for (i=0;i` + res + `
` + return res +} + +function Display(cnt) { + let score = cnt.indexOf(`"score":`)!=-1 ? cnt.split(`"score":`)[1].split("\n")[0]: "NA" + score = ""+ "" +"欺诈指数 " + " : " + ""+ ""+ score.replace(/"|,/g,"") +"" + let risk = cnt.indexOf(`"risk":`)!=-1 ? cnt.split(`"risk":`)[1].split("\n")[0] : "NA" + risk = ""+ "" +"风险等级 " + " : " + ""+ ""+ E2C(risk.replace(/"|,/g,"")) +"" + return (score+risk) +} + +//极高风险‼️、高风险⚠️ 和 中风险🟡 低风险✅ +function E2C(cnt){ + res = "NA" + if (cnt.indexOf("very high")!=-1) { + res = "极高风险 ‼️" + } else if(cnt.indexOf("high")!=-1) { + res = "高风险 ⚠️" + } else if(cnt.indexOf("medium")!=-1) { + res = "中风险 🟡" + } else if(nt.indexOf("low")!=-1) { + res = "低风险 ✅" + } + return res +} + +var flags = new Map([[ "AC" , "🇦🇨" ] ,["AE","🇦🇪"], [ "AF" , "🇦🇫" ] , [ "AI" , "🇦🇮" ] , [ "AL" , "🇦🇱" ] , [ "AM" , "🇦🇲" ] , [ "AQ" , "🇦🇶" ] , [ "AR" , "🇦🇷" ] , [ "AS" , "🇦🇸" ] , [ "AT" , "🇦🇹" ] , [ "AU" , "🇦🇺" ] , [ "AW" , "🇦🇼" ] , [ "AX" , "🇦🇽" ] , [ "AZ" , "🇦🇿" ] , ["BA", "🇧🇦"], [ "BB" , "🇧🇧" ] , [ "BD" , "🇧🇩" ] , [ "BE" , "🇧🇪" ] , [ "BF" , "🇧🇫" ] , [ "BG" , "🇧🇬" ] , [ "BH" , "🇧🇭" ] , [ "BI" , "🇧🇮" ] , [ "BJ" , "🇧🇯" ] , [ "BM" , "🇧🇲" ] , [ "BN" , "🇧🇳" ] , [ "BO" , "🇧🇴" ] , [ "BR" , "🇧🇷" ] , [ "BS" , "🇧🇸" ] , [ "BT" , "🇧🇹" ] , [ "BV" , "🇧🇻" ] , [ "BW" , "🇧🇼" ] , [ "BY" , "🇧🇾" ] , [ "BZ" , "🇧🇿" ] , [ "CA" , "🇨🇦" ] , [ "CF" , "🇨🇫" ] , [ "CH" , "🇨🇭" ] , [ "CK" , "🇨🇰" ] , [ "CL" , "🇨🇱" ] , [ "CM" , "🇨🇲" ] , [ "CN" , "🇨🇳" ] , [ "CO" , "🇨🇴" ] , [ "CP" , "🇨🇵" ] , [ "CR" , "🇨🇷" ] , [ "CU" , "🇨🇺" ] , [ "CV" , "🇨🇻" ] , [ "CW" , "🇨🇼" ] , [ "CX" , "🇨🇽" ] , [ "CY" , "🇨🇾" ] , [ "CZ" , "🇨🇿" ] , [ "DE" , "🇩🇪" ] , [ "DG" , "🇩🇬" ] , [ "DJ" , "🇩🇯" ] , [ "DK" , "🇩🇰" ] , [ "DM" , "🇩🇲" ] , [ "DO" , "🇩🇴" ] , [ "DZ" , "🇩🇿" ] , [ "EA" , "🇪🇦" ] , [ "EC" , "🇪🇨" ] , [ "EE" , "🇪🇪" ] , [ "EG" , "🇪🇬" ] , [ "EH" , "🇪🇭" ] , [ "ER" , "🇪🇷" ] , [ "ES" , "🇪🇸" ] , [ "ET" , "🇪🇹" ] , [ "EU" , "🇪🇺" ] , [ "FI" , "🇫🇮" ] , [ "FJ" , "🇫🇯" ] , [ "FK" , "🇫🇰" ] , [ "FM" , "🇫🇲" ] , [ "FO" , "🇫🇴" ] , [ "FR" , "🇫🇷" ] , [ "GA" , "🇬🇦" ] , [ "GB" , "🇬🇧" ] , [ "HK" , "🇭🇰" ] ,["HU","🇭🇺"], [ "ID" , "🇮🇩" ] , [ "IE" , "🇮🇪" ] , [ "IL" , "🇮🇱" ] , [ "IM" , "🇮🇲" ] , [ "IN" , "🇮🇳" ] , [ "IS" , "🇮🇸" ] , [ "IT" , "🇮🇹" ] , [ "JP" , "🇯🇵" ] , [ "KR" , "🇰🇷" ] , [ "LU" , "🇱🇺" ] , [ "MO" , "🇲🇴" ] , [ "MX" , "🇲🇽" ] , [ "MY" , "🇲🇾" ] , [ "NL" , "🇳🇱" ] , [ "PH" , "🇵🇭" ] , [ "RO" , "🇷🇴" ] , [ "RS" , "🇷🇸" ] , [ "RU" , "🇷🇺" ] , [ "RW" , "🇷🇼" ] , [ "SA" , "🇸🇦" ] , [ "SB" , "🇸🇧" ] , [ "SC" , "🇸🇨" ] , [ "SD" , "🇸🇩" ] , [ "SE" , "🇸🇪" ] , [ "SG" , "🇸🇬" ] , [ "TH" , "🇹🇭" ] , [ "TN" , "🇹🇳" ] , [ "TO" , "🇹🇴" ] , [ "TR" , "🇹🇷" ] , [ "TV" , "🇹🇻" ] , [ "TW" , "🇨🇳" ] , [ "UK" , "🇬🇧" ] , [ "UM" , "🇺🇲" ] , [ "US" , "🇺🇸" ] , [ "UY" , "🇺🇾" ] , [ "UZ" , "🇺🇿" ] , [ "VA" , "🇻🇦" ] , [ "VE" , "🇻🇪" ] , [ "VG" , "🇻🇬" ] , [ "VI" , "🇻🇮" ] , [ "VN" , "🇻🇳" ] , [ "ZA" , "🇿🇦"]])