package tamo;
public class pro {
String[] name=new String[4000];
int number;
String[] code=new String[4000];
String[] dic_code=new String[5000];
String[] dic_name=new String[5000];
public static void main(String[] args) {
pro t=new pro();
}
pro(){
int delta=0;
int y1;
for(y1=1982;y1<2015;y1++){
select sub=new select();
sub.makedata("1BCXvu_E0VeIFM_WN-SHx5zlLzzMr8Kgc8Qsi1weV",y1);
name=sub.name;
code=sub.code;
number=sub.number;
int s;
int sx;
dic_code[0]="";
for(s=1;s<number+1;s++){
int h=0;
for(sx=0;sx<delta+1;sx++){
if(code[s].equals(dic_code[sx]))h=100;
}
if(h<60)delta=delta+1;
if(h<60)dic_code[delta]=code[s];
if(h<60)dic_name[delta]=name[s];
}
}
int s;
for(s=1;s<delta+1;s++){
System.out.println(dic_name[s]);
}
System.out.println(delta);
}
}
package tamo;
import tool.*;
public class select{
int s,datanumber;
String[] data=new String[4000];
String[] name=new String[4000];
int number;
String[] code=new String[4000];
void makedata(String id,int yy){
String str1="%20";
String urlx="https://www.googleapis.com/fusiontables/v1/query?sql=SELECT";
urlx=urlx+str1+"*"+str1+"FROM"+str1+id+str1;
urlx=urlx+str1+"where"+str1+"y="+yy;
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[4];
name[s]=y[3];
}
for(s=1;s<x.length;s++){
name[s]=cg(name[s]);
code[s]=cg(code[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月22日 19:58