アットウィキロゴ

ブログ処理XXX

class pro{
int[] x=new int[10000];
int[] y=new int[10000];
int[] div=new int[10000];

String[] xml=new String[10000];
String[] credit=new String[10000];
int s,sx,n;
int xmlnumber,divnumber;
int z1,z2,p1,p2;

String bun,urlx,str;

public static void main(String args[]){
new pro();
}

pro(){



for (n=840;n<850;n++){

String nx;

nx=String.valueOf(n);

urlx="http://saayaworld.blog70.fc2.com/blog-entry-";
urlx=urlx+nx;
urlx=urlx+".html";

getdata get=new getdata();
get.makedata(urlx);
bun=get.bun;

xymaker(bun);


for(s=1;s<xmlnumber+1;s++){
xml[s]=makexml(s,bun);
}

for(s=1;s<xmlnumber;s++){
credit[s]=makecr(s,bun);
}

sx=0;
for(s=1;s<xmlnumber+1;s++){
if(xml[s].indexOf("div")>-1)sx=sx+1;
if(xml[s].indexOf("div")>-1)div[sx]=s;
}
divnumber=sx;

z1=0;
for(s=1;s<divnumber+1;s++){
sx=div[s];
if(xml[sx].indexOf("entry_body")>-1)z1=s;
}

z2=0;
for(s=1;s<divnumber+1;s++){
sx=div[s];
if(xml[sx].indexOf("entry_status")>-1)z2=s;
}

sx=div[z1];
p1=y[sx];
sx=div[z2];
p2=x[sx];

str=bun.substring(p1+1,p2);

xymaker(str);

for(s=1;s<xmlnumber;s++){
credit[s]=makecr(s,str);
}

str="";
for(s=1;s<xmlnumber;s++){
str=str+credit[s];
}

System.out.println(str);

}


}

String makecr(int s,String str){
int p1,p2;
String bara;
p1=y[s];
p2=x[s+1];
bara="";
if(p2>p1+1)bara=str.substring(p1+1,p2);
return bara;
}

String makexml(int s,String str){
int p1,p2;
String bara;
p1=x[s];
p2=y[s];
bara=str.substring(p1+1,p2);
return bara;
}

void xymaker(String str){
int p1;
int s;
s=1;
p1=str.indexOf("<");
x[1]=p1;
while(p1>-1){
p1=str.indexOf("<",p1+1);
if(p1>-1)s=s+1;
if(p1>-1)x[s]=p1;
}
xmlnumber=s;
for(s=1;s<xmlnumber+1;s++){
y[s]=str.indexOf(">",x[s]);
}

}




}
最終更新:2011年04月06日 11:57