Skip to content

Commit cd979eb

Browse files
committed
1 parent 76ab230 commit cd979eb

1 file changed

Lines changed: 31 additions & 3 deletions

File tree

Script/CheckIP.js

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,22 @@
2626
}
2727
}
2828
*/
29+
function ENWORD(par) {
30+
par = par.replace(/[\.\_\-\d]+/g," ")
31+
let myRequest = {
32+
url: "http://translate.google.cn/translate_a/single?client=gtx&sl=auto&tl=zh-CN&dt=t&q=" + encodeURI(par),
33+
method: "GET"
34+
};
35+
$task.fetch(myRequest).then(response => {
36+
//console.log($response.body)
37+
data = response.body
38+
par = data.split(/[\"]+/g)[1];
39+
console.log(par);
40+
return par;
41+
}, reason =>{
42+
return par;
43+
})
44+
}
2945
function ISP_ValidCheck(para) {
3046
if(para=="Microsoft Azure Cloud (eastasia)"){
3147
return "微软云服务"
@@ -77,13 +93,13 @@
7793
return "中西部"
7894
}
7995
else if(regionName=="臺灣省 or 台灣省"){
80-
return city0
96+
return "台湾省"
8197
}
8298
else if(regionName=="Moscow"){
8399
return "莫斯科"
84100
}
85101
else if(regionName=="新加坡"){
86-
return city0
102+
return "新加坡"
87103
}
88104
else if(regionName=="Tuen Mun"){
89105
return "屯门"
@@ -116,12 +132,24 @@
116132
{
117133
return "东京"
118134
}
135+
else if(regionName=="Taichung")
136+
{
137+
return "台中"
138+
}
119139
else
120140
{
121141
return regionName
122142
}
123143
}
124144
function Org_ValidCheck(para) {
145+
if(para.indexOf("Networks Limited")>-1){
146+
para = para.replace("Networks Limited","网络技术有限公司")
147+
return para
148+
}
149+
if(para.indexOf("AWS")>-1){
150+
para = para.replace("AWS","亚马逊云服务")
151+
return para
152+
}
125153
if(para=="Microsoft Azure Cloud (eastasia)"){
126154
return "微软云服务"
127155
}
@@ -194,4 +222,4 @@
194222
var subtitle =flags.get(obj['countryCode'])+City_ValidCheck(obj['city'])+'📀'+Org_ValidCheck(obj['org'])+'🌍'+obj['continent'];
195223
var ip = obj['query'];
196224
var description = '服务商:'+ISP_ValidCheck(obj['isp']) +'\n'+'DNS:'+ obj['reverse'] +'\n'+'地区:' +City_ValidCheck(obj['regionName'])+obj['district']+'\n' +'洲际:'+obj['continent'] +'\n'+'IP:'+obj['query'] +'\n' +'托管:'+ obj['hosting'];
197-
$done({title, subtitle, ip, description});
225+
$done({title, subtitle, ip, description});

0 commit comments

Comments
 (0)