调用一个查手机号的API

​http://api.showji.com/Locating/help.htm​

import win.ui;
/*DSG{{*/
var winform = ..win.form( min=false;bottom=291;parent=...;right=197;text="手机号归属地查询";max=false )
winform.add(
static4={ bottom=212;right=188;left=17;top=192;z=6;transparent=1;text="城市区号:";cls="static" };
static6={ bottom=277;right=188;left=17;top=257;z=8;transparent=1;text="卡 类 型:";cls="static" };
static3={ bottom=180;right=188;left=17;top=160;z=5;transparent=1;text="归属城市:";cls="static" };
edit={ bottom=38;right=171;left=17;multiline=1;top=13;z=1;edge=1;cls="edit" };
button={ bottom=80;right=94;left=16;top=51;z=2;text="查询";cls="button" };
static={ bottom=115;right=188;left=17;top=95;z=3;transparent=1;text="所查号码:";cls="static" };
static5={ bottom=244;right=188;left=17;top=224;z=7;transparent=1;text="城市邮编:";cls="static" };
static2={ bottom=148;right=188;left=17;top=128;z=4;transparent=1;text="归属省份:";cls="static" }
)
/*}}*/

winform.button.oncommand = function(id,event){
phone = winform.edit.text
if( #phone!=11){
winform.msgbox("号码必须是11位")
return ;
}
aa,bb,cc,dd,ee,ff,gg = get_phone( phone )
winform.static.text = "所查号码:"+ aa
winform.static2.text = "归属省份:"+ bb
winform.static3.text = "归属城市:"+ cc
winform.static4.text = "城市区号:"+ dd
winform.static5.text = "城市邮编:"+ ee
winform.static6.text = "卡 类 型:"+ ff + gg
}
get_phone = function( phone ){
import inet.whttp
http = inet.whttp( );
str= http.get( "http://api.showji.com/Locating/www.showji.com.aspx?m="+ phone +"&output=json&callback=querycallback");

win.msgbox( str,"Welcome to AAuto" )

str = string.fromto(str)

win.msgbox( str,"Welcome to AAuto" )

var regexExpression = "\a+\p+(\d+)\p+\a+\p+\a+\p+\a+\p+(:+)\p+\a+\p+(:+)\p+\a+\p+(\d+)\p+\a+\p+(\d+)\p+\a+\p+(:+)\p+\a+\p+(\a+)" ;
f = string.gmatch( str, regexExpression )
return f();
}
winform.show()
win.loopMessage();


AAuto 手机号码归属地查询_json