package book;
import tool.*;
public class pro {
int s,datanumber;
String[] data=new String[20000];
String[] credit=new String[50];
String[][] subdata=new String[5000][50];
int creditnumber,number;
public static void main(String[] args) {
pro t=new pro();
}
pro(){
String str1="%20";
String id="1sT0QUum_cHudUL0aN1UrxddXWEE1cCMnBNCLf_Vp";
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;s++){
str=str+data[s];
}
String[] x=str.split(" ],");
String strx=x[0];
int p1=strx.indexOf(" \"columns\":");
strx=strx.substring(p1,strx.length());
strx=strx.replace(" \"columns\": [","");
String[] y=strx.split(",");
for(s=0;s<y.length;s++){
credit[s]=cg(y[s]);
}
creditnumber=y.length;
x[1]=x[1].replace(" \"rows\": [","");
int sx;
for(s=1;s<x.length;s++){
String[] x1=x[s].split(",");
for(sx=0;sx<x1.length;sx++){
subdata[s][sx]=cg(x1[sx]);
System.out.println(subdata[s][sx]);
}
}
number=x.length-1;
}
String cg(String c){
int p1=c.indexOf("\"");
int p2=c.indexOf("\"",p1+1);
c=c.substring(p1+1,p2);
return c;
}
}
最終更新:2016年09月29日 15:50