アットウィキロゴ

検索87

package yati;
import tool.*;
 
 
public class pro {
 
  String[] year=new String[500];
String[] month=new String[500];
String[] day=new String[500];
int number; 
 
public static void main(String[] args) {
        pro te=new pro();
 
 
    }
 
pro(){
 
 
 
   search sub=new search();
   sub.makedata("214546");
   year=sub.year;
   month=sub.month;
   number=sub.number;
 
   int s;
   for(s=1;s<number+1;s++){
   System.out.println(year[number-s+1]+"年"+month[number-s+1]+"月");
   }
 
 
 
}
 
 
 
}
 
package yati;
 
import tool.*;
 
 
public class search {
 
  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[] year=new String[500];
String[] month=new String[500];
String[] day=new String[500];
int number; 
 
 
void makedata(String cc){
 
    	 String str1="%20";
 
        String id="1b1A3hL0UbFGjEt_TursiNcG56ZB8hr9ifm0RzF3E";
 
       String urlx="https://www.googleapis.com/fusiontables/v1/query?sql=SELECT";
       urlx=urlx+str1+"*"+str1+"FROM"+str1+id+str1+"where"+str1+"code="+cc;
       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++){  
 String[] y1=x[s].split(",");
 y[s]="";
 m[s]="";
 d[s]="";        
 for(sx=0;sx<y1.length;sx++){
 if(sx==0)y[s]=y1[sx];
if(sx==1)m[s]=y1[sx];
if(sx==2)d[s]=y1[sx];
 }
 
 
 }
 
 
 
 
 
 sx=0;
for(s=0;s<x.length;s++){
if(y[s].indexOf("\"")>-1)sx=sx+1;    
if(y[s].indexOf("\"")>-1)year[sx]=y[s];
if(y[s].indexOf("\"")>-1)month[sx]=m[s];
if(y[s].indexOf("\"")>-1)day[sx]=d[s];
}
 
 
 
number=sx;
for(s=1;s<number+1;s++){  
   int p2;
 p1=year[s].indexOf("\"");
    p2=year[s].indexOf("\"",p1+1);
    year[s]=year[s].substring(p1+1,p2);
p1=month[s].indexOf("\"");
p2=month[s].indexOf("\"",p1+1);
month[s]=month[s].substring(p1+1,p2);
p1=day[s].indexOf("\"");
p2=day[s].indexOf("\"",p1+1);
day[s]=day[s].substring(p1+1,p2);
}
 
 
 
 
 
}
 
 
 
}
 
最終更新:2016年09月02日 01:40