アットウィキロゴ

100nin

package delta;
 
import tool.*;
 
public class pro {
 
int s,datanumber;
String[] data=new String[4000];
    String[] name=new String[4000];
    String[] code=new String[4000];
  int number;
 
    public static void main(String[] args) {
       pro t=new pro();
    }
 
    pro(){
 
 
        kine sub=new kine();
        sub.makedata();
        name=sub.name;
        number=sub.number;
        code=sub.code;
 
 
 
         for(s=1;s<number+1;s++){
 
 
           System.out.println(name[s]+","+code[s]);  
         }
 
 
 
 
 
    }
 
 
 
}
 
 
package delta;
 
 
import tool.*;
 
public class kine{
 
int s,datanumber;
String[] data=new String[4000];
    String[] name=new String[4000];
    String[] code=new String[4000];
  int number;
 
 
    void makedata(){
 
         String str1="%20";
 
        String id="1_6t6wrgLzqL0OhbgQTlrjsKwBP6JehgPeTQK01WZ";
 
       String urlx="https://www.googleapis.com/fusiontables/v1/query?sql=SELECT";
       urlx=urlx+str1+"*"+str1+"FROM"+str1+id+str1;
       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];
 
        }
 
        str=str.replace("\"rows\": ","");
 
        String[] x=str.split("],");
         for(s=1;s<x.length;s++){
           String[] y=x[s].split(",");
           code[s]=y[1];
           name[s]=y[0];
         }
 
 
         for(s=1;s<x.length;s++){
 
           code[s]=cg(code[s]);
           name[s]=cg(name[s]);  
         }
 
         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月06日 21:52