package tamosan;
import tool.*;
public class pro {
int s,datanumber;
String[] data=new String[50000];
int[] a=new int[100];
int[] b=new int[100];
String[] subdata=new String[50000];
String[] day=new String[50000];
public static void main(String[] args) {
pro test=new pro();
}
pro(){
int tr;
for(tr=82;tr<114;tr++){
String k=""+tr+"10";
int n=tr-100;
if(tr>99)k="0"+n+"10";
if(tr>109)k=n+"10";
String urlx="";
urlx="http://www007.upp.so-net.ne.jp/iitomo/telelist/etom"+k+".htm";
if(tr==113)urlx="http://www007.upp.so-net.ne.jp/iitomo/etom1310.htm";
getdata sub7=new getdata();
sub7.makedata(urlx,"SJIS");
data=sub7.data;
datanumber=sub7.datanumber;
String pp="<div class=\"entryBody\">";
int sx=0;
String str="";
for(s=1;s<datanumber+1;s++){
str=str+data[s];
}
String[] x=str.split("<TR>");
int tx=0;
for(s=1;s<x.length;s++){
String[] y=x[s].split("</TD>");
for(sx=0;sx<y.length;sx++){
y[sx]=change(y[sx]);
tx=tx+1;
subdata[tx]=y[sx];
}
}
int number=tx;
for(s=1;s<number+1;s++){
String strx="";
if(subdata[s].indexOf("/")>-1)strx=subdata[s];
int p1=strx.indexOf("/");
String s1="";
String s2="";
if(p1>-1)s1=strx.substring(p1+1,p1+2);
if(p1>-1)s2=strx.substring(p1+1,p1+3);
int n1=numx(s1);
int n2=numx(s2);
int px=p1+2;
if(n2>0)px=p1+3;
day[s]="";
if(p1>-1)day[s]=subdata[s].substring(0,px);
subdata[s]=subdata[s].replace(day[s],"");
if(day[s].length()>0)System.out.println((tr+1900)+","+day[s]+","+subdata[s]);
}
}
}
String change(String str){
int n;
for(n=1;n<11;n++){
str=rev(str);
}
return str;
}
String rev(String str){
if(str==null)str="";
int p1=str.indexOf("<");
int p2=-1;
if(p1>-1)p2=str.indexOf(">",p1);
String strx="";
if(p2>-1)strx=str.substring(p1,p2+1);
str=str.replace(strx,"");
return str;
}
int numx(String str){
int nx;
nx=0;
try{
nx=Integer.parseInt(str);
}catch (Exception e) {}
return nx;
}
}
最終更新:2016年09月06日 23:29