package dl;
import tool.*;
public class pro {
int s,number;
String[] data=new String[5000];
String[] codex=new String[5000];
String[] code=new String[5000];
String[] name=new String[5000];
String[] y=new String[500];
String[] m=new String[500];
String[] d=new String[500];
public static void main(String[] args) {
pro te=new pro();
}
pro(){
int tr;
for(tr=1982;tr<2015;tr++){
select sub=new select();
sub.makedata(tr);
number=sub.number;
name=sub.namex;
code=sub.codex;
for(s=1;s<number+1;s++){
System.out.println(name[s]+","+code[s]);
}
}
}
}
package dl;
import tool.*;
public class select{
int s,datanumber;
String[] data=new String[5000];
String[] codex=new String[5000];
String[] code=new String[5000];
String[] name=new String[5000];
String[] y=new String[500];
String[] m=new String[500];
String[] d=new String[500];
String[] a=new String[500];
String[] namex=new String[5000];
String[] yx=new String[500];
String[] mx=new String[500];
String[] dx=new String[500];
int number;
void makedata(int pp){
String str1="%20";
String id="1BCXvu_E0VeIFM_WN-SHx5zlLzzMr8Kgc8Qsi1weV";
String urlx="https://www.googleapis.com/fusiontables/v1/query?sql=SELECT";
urlx=urlx+str1+"*"+str1+"FROM"+str1+id+str1+"where"+str1+"y="+pp;
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++){
name[s]="";
code[s]="";
String[] y1=x[s].split(",");
for(sx=0;sx<y1.length;sx++){
if(sx==0)a[s]=y1[sx];
if(sx==1)y[s]=y1[sx];
if(sx==2)m[s]=y1[sx];
if(sx==3)d[s]=y1[sx];
if(sx==4)name[s]=y1[sx];
if(sx==5)code[s]=y1[sx];
}
}
code[0]=name[0];
name[0]=d[0];
d[0]=m[0];
m[0]=y[0];
y[0]=a[0];
sx=0;
for(s=0;s<x.length;s++){
if(name[s].indexOf("\"")>-1)sx=sx+1;
if(name[s].indexOf("\"")>-1)namex[sx]=name[s];
if(name[s].indexOf("\"")>-1)yx[sx]=y[s];
if(name[s].indexOf("\"")>-1)mx[sx]=m[s];
if(name[s].indexOf("\"")>-1)dx[sx]=d[s];
if(name[s].indexOf("\"")>-1)codex[sx]=code[s];
}
number=sx;
for(s=1;s<number+1;s++){
p1=namex[s].indexOf("\"");
int p2=namex[s].indexOf("\"",p1+1);
namex[s]=namex[s].substring(p1+1,p2);
p1=yx[s].indexOf("\"");
p2=yx[s].indexOf("\"",p1+1);
yx[s]=yx[s].substring(p1+1,p2);
p1=mx[s].indexOf("\"");
p2=mx[s].indexOf("\"",p1+1);
mx[s]=mx[s].substring(p1+1,p2);
p1=dx[s].indexOf("\"");
p2=dx[s].indexOf("\"",p1+1);
dx[s]=dx[s].substring(p1+1,p2);
p1=codex[s].indexOf("\"");
p2=codex[s].indexOf("\"",p1+1);
codex[s]=codex[s].substring(p1+1,p2);
if(codex[s].indexOf("N")>-1)codex[s]="";
}
}
}
最終更新:2016年09月12日 23:00