アットウィキロゴ

kensaku cbb

package book;
 
 
import tool.*;
 
public class select_all {
 
    int s,datanumber;
    String[] data=new String[20000];
  String[] credit=new String[50];
 
   String[][] subdata=new String[5000][50];
  int creditnumber,number;
 
 
 
    void makedata(String id){
 
         String str1="%20";
 
 
       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]);  
}
 }
 
 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;
    }
 
 
 
 
}
 
 
 
 
 
 
 
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 id="1yfaookdLpJzwugBsn884Xu1opaXHpnXj22TTFsPR";
 
 
 
 
        select_all sub=new select_all();
        sub.makedata(id);
        credit=sub.credit;
        number=sub.number;
        creditnumber=sub.creditnumber;
        subdata=sub.subdata;
 
        for(s=1;s<creditnumber+1;s++){
        System.out.println((s-1)+","+credit[s-1]);    
        } 
 
        for(s=1;s<number+1;s++){
        System.out.println(subdata[s][3]);    
        } 
 
 
 
 
 
    }
 
 
 
 
 
}
 
最終更新:2016年09月29日 16:23