package dl2;
import tool.*;
public class pro {
int s,datanumber;
String[] [[data]]=new String[5000];
String[] [[memo]]=new String[5000];
public int number;
public String[] subtitle=new String[250];
public String[] subdata=new String[50000];
public String[] [[link]]=new String[50000];
public String title,author;
public int[] subnumber=new int[200];
public static void main(String[] args) {
pro t=new pro();
}
pro(){
int [[delta]]=0;
readfile sub5=new readfile();
sub5.makedata("data.csv","UTF-8");
link=sub5.data;
delta=sub5.datanumber;
System.out.println(link[1]);
int tr=21;
[[for]](tr=1;tr<delta+1;tr++){
String urlx=link[tr];
getdata sub=new getdata();
sub.makedata(urlx,"EUC-JP");
data=sub.data;
datanumber=sub.datanumber;
String dd="<td itemprop=\"articleBody\" class=\"entryTd\">";
int s1=0;
for(s=1;s<datanumber+1;s++){
if(data[s].indexOf(dd)>-1)s1=s;
}
String d2="__entry_[[body]]_end__";
int s2=0;
for(s=s1;s<datanumber+1;s++){
if(data[s].indexOf(d2)>-1)s2=s;
}
int sx=0;
for(s=s1;s<s2;s++){
sx=sx+1;
subdata[sx]=clean_str(data[s]);
}
int number=sx;
String t="";
for(s=1;s<datanumber+1;s++){
if(data[s].indexOf("<title>")>-1)t=clean_str(data[s]);
}
t=t.replace("- 彩の秘密の部屋 - Yahoo!ブログ","");
t=t.trim();
System.out.println(t);
writefile sub7=new writefile();
sub7.data=subdata;
sub7.datanumber=number;
sub7.makedata("data/"+t+".txt");
}
}
String clean_str(String str){
int m;
String strx=str;
for(m=1;m<15;m++){
strx=[[fresh]](strx);
}
strx=strx.replace(" ","");
strx=strx.replace(" ","");
strx=strx.replace(";","");
return strx;
}
String fresh(String str){
int p1=str.indexOf("<");
int p2=str.indexOf(">",p1);
String sp="";
if(p1>-1)sp=str.substring(p1,p2+1);
String k=str.replace(sp,"");
return k;
}
}
最終更新:2017年12月10日 13:54