package smiyj;
import tool.*;
public class pro {
int s,datanumber;
String[] data=new String[5000];
String[] link=new String[5000];
String[] subdata=new String[5000];
public static void main(String[] args) {
pro t=new pro();
}
pro(){
int tr;
for(tr=1;tr<162;tr++){
String urlx="http://otokonomesuochi.blog.fc2.com/blog-entry-"+tr+".html";
getdata sub=new getdata();
sub.makedata(urlx,"UTF-8");
data=sub.data;
datanumber=sub.datanumber;
int s1=0;
for(s=1;s<datanumber+1;s++){
if(data[s].indexOf("entry-content clearfix")>-1)s1=s;
}
int h;
int s2=0;
for(s=s1+1;s<datanumber+1;s++){
h=0;
if(data[s].indexOf("<script")>-1)h=h+1;
if(s2==0)h=h+1;
if(h==2)s2=s;
}
int z=0;
if(s1>0)z=z+1;
if(s2>0)z=z+1;
if(z==2){
int sx=0;
for(s=s1;s<s2+1;s++){
data[s]=change(data[s]);
sx=sx+1;
subdata[sx]=data[s];
}
writefile sub3=new writefile();
sub3.data=subdata;
sub3.datanumber=sx;
sub3.makedata("data/"+tr+".txt");
}
}
}
String change(String str){
int n;
for(n=1;n<51;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(p1>-1)strx=str.substring(p1,p2+1);
str=str.replace(strx,"");
return str;
}
}
最終更新:2016年06月01日 04:25