class ydbase{
String urlx;
String ctitle[]=new String[1000];
int cyear[]=new int[1000];
int cday[]=new int[1000];
String cmonth[]=new String[1000];
int chnumber;
int ccode;
String[] article=new String[1000];
String[] title=new String[1000];
String[] link=new String[1000];
int[] year=new int[1000];
int[] day=new int[1000];
String[] month=new String[1000];
String[] des=new String[1000];
int articlenumber;
int s,sx;
int originaldata;
int plan[]=new int[100];
String name;
String dbtable;
public static void main(String [] args) {
ydbase test= new ydbase();
}
ydbase(){
urlx="http://finance.yahoo.com/rss/headline?s=GOOG";
dbtable="pop";
ccode=1;
name="yu";
yahooac yac=new yahooac();
yac.makedata(urlx);
articlenumber=yac.articlenumber;
article=yac.article;
title=yac.title;
day=yac.day;
year=yac.year;
month=yac.month;
des=yac.des;
link=yac.link;
ychdata ch=new ychdata();
ch.makedata(dbtable,ccode);
ch.makedn(dbtable);
chnumber=ch.chnumber;
originaldata=ch.originaldata;
cyear=ch.cyear;
cmonth=ch.cmonth;
cday=ch.cday;
ctitle=ch.ctitle;
yinsertdata is=new yinsertdata();
is.name=name;
is.ccode=ccode;
is.year=year;
is.month=month;
is.day=day;
is.title=title;
is.link=link;
is.des=des;
sx=originaldata;
for(s=0;s<articlenumber;s++){
if(plan[s]<50)sx=sx+1;
if(plan[s]<50)is.makedata(dbtable,sx,s);
}
}
void planx(){
int h,z;
for(s=0;s<articlenumber;s++){
z=0;
plan[s]=0;
for(sx=1;sx<chnumber+1;sx++){
h=0;
if(year[s]==cyear[sx])h=h+1;
if(month[s].equals(cmonth[sx]))h=h+1;
if(day[s]==cday[sx])h=h+1;
if(title[s].equals(ctitle[sx]))h=h+1;
if(h==4)z=100;
}
if(z>50)plan[s]=100;
}
}
}
最終更新:2011年03月30日 19:56