アットウィキロゴ

声優でーy

import java.io.*;

class pro{

String urlx,str;
String data;
int s,sx,xmlnumber,authornumber;
int[] x=new int[5000];
int[] y=new int[5000];
String[] credit=new String[5000];
String[] name=new String[5000];
String[] author=new String[5000];
int page;
int h,p1,p2;

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

pro(){

for(page=1;page<1002;page++){

urlx="http://www.seigura.com/senior/directory/directory_detail/tabid/127/seiyuid/";
urlx=urlx+page;
urlx=urlx+"/Default.aspx";

getdata g=new getdata();
g.makedata(urlx);
data=g.data;

xymaker();

for(s=1;s<xmlnumber+1;s++){
credit[s]=data.substring(x[s],y[s]);
}

for(s=1;s<xmlnumber+1;s++){
h=0;
if(credit[s].indexOf("span id=")>-1)h=h+1;
if(credit[s].indexOf("kanji")>-1)h=h+1;
if(h==2)sx=s;
}
p1=y[sx];
p2=x[sx+1];
str="入手不能";
if(p2>p1)str=data.substring(p1+1,p2);

str=str.replace(" ","△");
str=str.replace("△","");
name[page]=str;
}

sx=0;
for(page=1;page<1002;page++){
h=0;
if(name[page].equals("入手不能"))h=100;
if(name[page]==null)h=100;
if(name[page].length()<2)h=100;
if(h<50)sx=sx+1;
if(h<50)author[sx]=name[page];
}
authornumber=sx;

writefile();


}

void writefile(){

try{
PrintWriter pw = new PrintWriter (new BufferedWriter(new FileWriter("db.txt")));

for(s=1;s<authornumber+1;s++){
pw.println(author[s]);
}
  
System.out.println("ファイルに書きこみました。");
pw.close();
} catch(IOException ep){ System.out.println("入出力エラーです。"); }


}


void xymaker(){
int s,p1;
s=1;
p1=data.indexOf("<");
x[s]=p1;
while(p1>-1){
p1=data.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]=data.indexOf(">",x[s]);
}

}
}
最終更新:2011年07月05日 04:30