アットウィキロゴ

yukilll

package yuki;
 
import tool.getdata;
import simple.epub;
 
public class novel {
 
 
     int s,datanumber;
    String[] data=new String[5000];
   String[] link=new String[5000];
  String[] web=new String[5000];
  String[] memo=new String[5000];
     String[] subtitle=new String[5000];
 
    void makedata(String urlx){
 
 
 
 
   getdata sub2=new getdata();
   sub2.makedata(urlx,"SJIS");
   data=sub2.data;
   datanumber=sub2.datanumber;
 
 int sx=0;
   for(s=1;s<datanumber+1;s++){
 int h=0;
   if(data[s].indexOf("index.html")>-1)h=h+1;
     if(data[s].indexOf("page")>-1)h=h+1;
   if(h==2)sx=sx+1;
    if(h==2)web[sx]=data[s];
   }
 
   System.out.println(sx);
 
 
   String title="";
   for(s=1;s<datanumber+1;s++){
       int h=0;
    if(data[s].indexOf("</FONT></TD>")>-1)h=h+1;
    if(title.length()==0)h=h+1; 
    if(h==2)title=data[s];
 
    }
 
   title=change(title);
 
   sx=0;
    for(s=1;s<datanumber+1;s++){
    if(data[s].indexOf("</FONT></TD>")>-1)sx=sx+1; 
    if(data[s].indexOf("</FONT></TD>")>-1)subtitle[sx]=data[s];
    }
 
 
 
    for(s=1;s<sx+1;s++){
    subtitle[s]=change(subtitle[s]);
    }
 
 
   System.out.println(title);
   int delta=sx-2;
   System.out.println(delta);
 
 
   for(s=2;s<delta+2;s++){
 
       int p1=web[s].indexOf("page");
      int p2=web[s].indexOf("html",p1);
     String kk=urlx;
    kk=kk.replace("left.html","");
   web[s]=web[s].substring(p1,p2);
    web[s]=kk+web[s];
    web[s]=web[s].replace("index.","text.html"); 
   }
 
   int t;
   int[] subnumberx=new int[500];
    String[] subtitlex=new String[500];
   String[][] subdata=new String[100][5000];
 
   for(t=1;t<delta+1;t++){
 
   getdata sub3=new getdata();
   sub3.makedata(web[t+1],"SJIS");
   data=sub3.data;
   datanumber=sub3.datanumber;
 
   sx=0;
   for(s=2;s<datanumber+1;s++){
   data[s]=change(data[s]);
   if(data[s].length()>0)sx=sx+1;
  if(data[s].length()>0)memo[sx]=data[s];  
   }     
 
   int sigma=sx;
   subnumberx[t]=sigma;
 
 
 
 
   for(s=1;s<sigma+1;s++){
   subdata[t][s]=memo[s];    
   }
 
   subtitlex[t]=subtitle[t+2];    
   }
 
 
 
 
epub sub4=new epub();
sub4.title=title;
sub4.author="由紀";
sub4.number=delta;
sub4.subnumber=subnumberx;
sub4.subdata=subdata;
sub4.subtitle=subtitlex;
sub4.makedata("book/"+title+".kepub.epub");
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
    }
     String change(String str){
 
        int n;
        for(n=1;n<51;n++){
        str=rev(str);    
        }
 
        str=str.replace(" ","");
 
        return str;
    }
 
 String rev(String str){
 
        if(str==null)str="";
 
        int p1=str.indexOf("<");
        int p2=str.indexOf(">",p1);
        String strx="";
 
        int h=0;
        if(p1>-1)h=h+1;
        if(p2>-1)h=h+1; 
        if(h==2)strx=str.substring(p1,p2+1);
        str=str.replace(strx,"");
 
        return str;
    }     
 
 
 
 
}
 
 
 
 
package yuki;
 
import tool.*;
 
public class pro {
 
 
 
    int s,datanumber;
    String[] data=new String[5000];
   String[] link=new String[5000];
  String[] web=new String[5000];
 
  String[] memo=new String[5000];
 
  public static void main(String[] args) {
        pro t=new pro();
    }
    pro(){
 
 
 
        String urlx="http://www2.big.or.jp/~interx/yuki/ms/bookshelf3/index.html";
 
          getdata sub=new getdata();
   sub.makedata(urlx,"SJIS");
   data=sub.data;
   datanumber=sub.datanumber;
 
 int sx=0;
   for(s=1;s<datanumber+1;s++){
   if(data[s].indexOf("index.html")>-1)sx=sx+1;
    if(data[s].indexOf("index.html")>-1)link[sx]=data[s];
 
   }
 
 
   for(s=2;s<sx+1;s++){
       int p1=link[s].indexOf("book");
        int p2=link[s].indexOf("html",p1);
       link[s]=link[s].substring(p1,p2);
       link[s]="http://www2.big.or.jp/~interx/yuki/ms/bookshelf3/"+link[s].replace("index.","left.html"); 
    }
 
 
   for(s=2;s<sx+1;s++){
   novel sub2=new novel();
   sub2.makedata(link[s]);
   }
 
 
 
    }
 
 
}
 
最終更新:2016年11月07日 02:36