本帖最后由 pcl_test 于 2016-4-10 12:42 编辑
- //&cls&cscript -nologo -e:jscript "%~f0"<gui-config.json&pause&exit
-
- var http = new ActiveXObject('MSXML2.XMLHTTP');
- http.open('GET', 'http://www.ishadowsocks.net/', false);
- http.send();
- var i = -1, txt = http.responseText.match(/<section id=\"free\">[\s\S]+?<\/section>/).toString().match(/[^>]*服务[^<]*|[^>]*端口[^<]*|[^>]*密码\s*[::][^<]*|[^>]*加密[^<]*/g);
- var config = WSH.StdIn.ReadAll().replace(/"server"[^,]+|"server_port"[^,]+|"password"[^,]+|"method"[^,]+/g, function($0){
- i++;var a = $0.split(':')[0], b = txt[i].split(/[\s::]+/)[1];
- return i==1?a+': '+b:a+': "'+b+'"';
- });
- WSH.echo(config);
复制代码
|