class pro{
String urlx;
String data,bun,str1,str2,z1,z2,z3;
String[] z=new String[400];
int p1,p2;
int[] x=new int[100];
int[] y=new int[100];
int[] year=new int[5000];
int s,sx,xmlnumber;
String[] xml=new String[100];
int h,n;
String [] title=new String[50000];
String [] content=new String[50000];
String [] date=new String[50000];
int code,ycode;
public static void main(String [] args) {
pro test=new pro();
}
pro(){
n=3;
code=9544;
makedata(n,code);
System.out.println(title[n]);
System.out.println(content[n]);
System.out.println(date[n]);
}
void makedata(int n,int code){
title[n]="";
date[n]="";
content[n]="";
ycode=1000000+code;
urlx="http://messages.yahoo.co.jp/bbs?.mm=FN&action=m&board=";
urlx=urlx+ycode;
urlx=urlx+"&tid=";
urlx=urlx+code;
urlx=urlx+"&sid=";
urlx=urlx+ycode;
urlx=urlx+"&mid=";
urlx=urlx+n;
getdata gt=new getdata();
gt.makedata(urlx);
data=gt.data;
str1="<!--// MESSAGE -->";
str2="<!--// /MESSAGE -->";
p1=data.indexOf(str1);
p2=data.indexOf(str2);
h=0;
if(p1<1)h=100;
if(p2<1)h=100;
while(h<50){
bun=data.substring(p1,p2);
xymaker(bun);
z2="";
for(s=1;s<xmlnumber-1;s++){
p1=y[s];
p2=x[s+1];
z1=bun.substring(p1+1,p2);
if(z1.length()>0)z2=z1;
}
content[n]=z2;
str1="<!--// MAIN TOPIC -->";
str2="<!--// USER -->";
p1=data.indexOf(str1);
p2=data.indexOf(str2);
bun=data.substring(p1,p2);
xymaker(bun);
z2="";
sx=0;
for(s=1;s<xmlnumber-1;s++){
p1=y[s];
p2=x[s+1];
z1=bun.substring(p1+1,p2);
if(z1.length()>0)sx=sx+1;
if(z1.length()>0)z[sx]=z1;
}
title[n]=z[1];
date[n]=z[2];
h=100;
}
}
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月18日 16:54