package city2;
import tool.*;
import java.io.File;
public class pro {
int s,datanumber;
String[] data=new String[40000];
String[] link=new String[40000];
String[] name=new String[40000];
String[] music=new String[40000];
String[] code=new String[5000];
String[] year=new String[5000];
String[] r=new String[5000];
String[] imx=new String[60];
int number;
public static void main(String[] args) {
pro t=new pro();
}
pro(){
city250 sub=new city250();
sub.makedata();
name=sub.name;
code=sub.code;
number=sub.number;
for(s=1;s<number+1;s++){
System.out.println(name[s]+","+code[s]);
}
}}
package city2;
import tool.*;
public class city250 {
int s,datanumber;
String[] data=new String[5000];
String[] code=new String[5000];
String[][] namex=new String[50][50];
String[] name=new String[5000];
String[] year=new String[5000];
String[] r=new String[5000];
int number;
void makedata(){
String str1="%20";
String id="13oY_ATNC7diJaU1KYs05JGgBNBUrNjn1qzKsMKL6";
String urlx="https://www.googleapis.com/fusiontables/v1/query?sql=SELECT";
urlx=urlx+str1+"*"+str1+"FROM"+str1+id;
urlx=urlx+"&key=AIzaSyAH0WCAXRIdHdbI-6bnMSN4kVDDZZmGyqY";
getdata sub=new getdata();
sub.makedata(urlx,"UTF-8");
data=sub.data;
datanumber=sub.datanumber;
String str="";
for(s=1;s<datanumber+1;s++){
str=str+data[s];
}
int p1=str.indexOf("rows");
p1=str.indexOf(":",p1);
str=str.substring(p1,str.length());
int sx;
int tx=0;
String[] x=str.split("],");
for(s=0;s<x.length;s++){
String[] y=x[s].split(",");
for(sx=0;sx<y.length;sx++){
if(sx==0)name[s+1]=cg(y[sx]);
if(sx==1)code[s+1]=cg(y[sx]);
}
}
number=x.length;
}
String cg(String c){
int p1=c.indexOf("\"");
int p2=c.indexOf("\"",p1+1);
c=c.substring(p1+1,p2);
return c;
}
}
最終更新:2016年09月11日 08:34