アットウィキロゴ

まけてxt

class maketext{

String[] article=new String[50000];
String[] text=new String[50000];
int s,articlenumber;

void makedata(String urlx){

article ar=new article();
ar.makedata(urlx);
article=ar.article;
articlenumber=ar.articlenumber;

for(s=1;s<articlenumber+1;s++){
text[s]=makedd(article[s]);
}

}

String edits(String str){

String d4,str1;
int p1;

str1="スポンサードリンク";
p1=str.indexOf(str1);
d4=str;
if(p1>0)d4=d4.substring(0,p1);
return d4;
}
String editc(String str){
int t,h,p1,p2;
String d3;
d3=str;
t=0;
while(t<50){
p1=d3.indexOf("<a");
p2=d3.indexOf("</a>",p1);
h=0;
if(p1>-1)h=h+1;
if(p2>p1)h=h+1;
if(h==2)d3=editb(d3);
if(h<2)t=100;
t=t+1;
}
return d3;

}

String editb(String str){
int p1,p2;
String word,d3;
p1=str.indexOf("<a");
p2=str.indexOf("</a>",p1);
d3=str;
word="";
if(p1>-1)word=str.substring(p1,p2+4);
if(p1>-1)d3=str.replace(word,"");
return d3;
}


String edita(String str){
String d2;
d2=str.replace("<br />","");
d2=d2.replace("<br/>","");
return d2;
}


String makedd(String str){
String str1,str2,d1;
int p1,p2;
str1="<dd>";
str2="</dd>";
p1=str.indexOf(str1);
p2=str.indexOf(str2);
d1="";
if(p2>p1+4)d1=str.substring(p1+4,p2);
d1=edits(d1);
d1=edita(d1);
d1=editc(d1);
return d1;
}
}
最終更新:2011年07月17日 15:30