アットウィキロゴ

だうrn

package uta;
import tool.*;
 
public class pro {
 
 
 
 
    int s,datanumber;
    String[] data=new String[6000];
 String[] a=new String[6000];
    String[] b=new String[6000];
String[] c=new String[6000];
 
  String[] d=new String[6000];
String[] e=new String[6000];
String[] de=new String[6000];
 String[] link=new String[6000];
 String[] date=new String[6000];
String[] ar=new String[6000];
String[] t=new String[6000];
 
public static void main(String[] args) {
        pro te=new pro();
 
 
    }
 
 pro(){
 
 
 
    link[1]= "1996utaban.htm";
       link[2]="1997utarate.htm";
       link[3]= "utabann1998.htm";
        link[4]="uta1999rate.htm";
       link[5]= "2000ratinguta.htm";
     link[6]="2001eejump.htm";
       link[7]= "2002hitomi.htm";
        link[8]="2003rag.htm";
        link[9]="2004kinki.htm";
       link[10]="2005sonin.htm";
       link[11]="2006utaban0112.htm";
    link[12]="2007utaban0111.html";
 
 
 
 
     int tr;
        for(tr=1;tr<13;tr++){
 
           String urlx="http://ifs.nog.cc/tonton36.hp.infoseek.co.jp/data/"+link[tr];
           if(tr>9)urlx="http://ifs.nog.cc/tonton36.hp.infoseek.co.jp/"+link[tr];
 
 
        getdata sub7=new getdata();
        sub7.makedata(urlx,"SJIS");
        data=sub7.data;
        datanumber=sub7.datanumber; 
 
 
 String str="";
        for(s=1;s<datanumber+1;s++){
 str=str+data[s];
 
 
        } 
 
 
         str=str.replace("</TD>","</td>");
        str=str.replace("</TR>","</tr>");
        String[] x=str.split("</tr>");
 
        int sx;
  for(s=1;s<x.length-1;s++){      
 x[s]=x[s].replace("&nbsp;","");
  x[s]=x[s].replace("S","");
   x[s]=x[s].replace("*","");
      String[] y=x[s].split("</td>");
 
 a[s]="";
 b[s]="";
 c[s]="";
 d[s]="";
 e[s]="";
 de[s]="";
 for(sx=0;sx<y.length;sx++){   
   if(sx==0)de[s]=change(y[sx]);
   if(sx==1)a[s]=change(y[sx]);
  if(sx==2)b[s]=change(y[sx]);
  if(sx==3)c[s]=change(y[sx]);
 if(sx==4)d[s]=change(y[sx]);
  if(sx==5)e[s]=change(y[sx]);
 }
  }
 
  int number=x.length-2;
 
 
 for(s=1;s<number+1;s++){
 
   System.out.println((tr+1995)+","+de[s]+","+a[s]+","+b[s]+","+c[s]+","+d[s]+","+e[s]);  
 }
 
        }
 
 
    } 
String change(String str){
 
        int n;
        for(n=1;n<11;n++){
        str=rev(str);    
        }
 
        str=str.replace(" ","");
 
        return str;
    }
 
 String rev(String str){
 
        if(str==null)str="";
 
        int p1=str.indexOf("<");
        int p2=str.indexOf(">",p1);
        String strx="";
        if(p2>-1)strx=str.substring(p1,p2+1);
        str=str.replace(strx,"");
 
        return str;
    }    
 
 
 
 
}
 
最終更新:2016年09月04日 01:00