用fp7打开,fp8有安全砂箱,演示效果截图如下:
/*////////////////////////
/*
/*
/* by yellow
/* yellowboydesign@gmail.com
/* http://yellowboy.cn
/*
*/
///////////////////////
stop();
System.useCodepage = true;
fpv_cn = new LoadVars();
fpv_cn.load("http://www.tq121.com.cn/forecast/cf.php");
fpv_cn_weather = new Array();
tempcity = new Array();
tempw = new Array();
temphot = new Array();
tempwind = new Array();
tempwinds = new Array();
fpv_cn_out = "
";
fpv_cn_city = "城市:";
fpv_cn_w = "天气:";
fpv_cn_hot = "温度:";
fpv_cn_wind = "风向:";
fpv_cn_winds = "风力:";
fpv_cn.onData = function(data) {
fpv_cn_str = new String(data);
for (i=7500; i
//城市
if (fpv_cn_str.slice(i, i+fpv_cn_city.length) == fpv_cn_city) {
for (j=i; j
if (fpv_cn_str.slice(j, j+fpv_cn_out.length) == fpv_cn_out) {
tempcity.push(fpv_cn_str.slice(i+fpv_cn_city.length, j-1));
break;
}
}
}
//天气
if (fpv_cn_str.slice(i, i+fpv_cn_w.length) == fpv_cn_w) {
for (k=i; k
if (fpv_cn_str.slice(k, k+fpv_cn_out.length) == fpv_cn_out) {
tempw.push(fpv_cn_str.slice(i+fpv_cn_w.length, k));
break;
}
}
}
//温度
if (fpv_cn_str.slice(i, i+fpv_cn_hot.length) == fpv_cn_hot) {
for (l=i; l
if (fpv_cn_str.slice(l, l+fpv_cn_out.length) == fpv_cn_out) {
temphot.push(fpv_cn_str.slice(i+fpv_cn_hot.length, l));
break;
}
}
}
//风向
if (fpv_cn_str.slice(i, i+fpv_cn_wind.length) == fpv_cn_wind) {
for (m=i; m
if (fpv_cn_str.slice(m, m+fpv_cn_out.length) == fpv_cn_out) {
tempwind.push(fpv_cn_str.slice(i+fpv_cn_wind.length, m));
break;
}
}
}
//风力
if (fpv_cn_str.slice(i, i+fpv_cn_winds.length) == fpv_cn_winds) {
for (n=i; n
if (fpv_cn_str.slice(n, n+fpv_cn_out.length) == fpv_cn_out) {
tempwinds.push(fpv_cn_str.slice(i+fpv_cn_winds.length, n));
break;
}
}
}
}
//放进数组
//city:城市,w:天气,hot:温度,wind:风向,winds:风力
for (o=0; o
fpv_cn_weather.push({city:tempcity[o], w:tempw[o], hot:temphot[o], wind:tempwind[o], winds:tempwinds[o]});
}
//排序
fpv_cn_weather.sortOn("city");
play();
};