アットウィキロゴ

lx44

package uni;
import tool.*; 
import epub2.epub_kadokawa;
 
public class pro {
 
     int s,datanumber;
    String[] data=new String[5000];
     String[] memo=new String[5000];
 
      public  int number;
  public String[] subtitle=new String[250];
  public String[][] subdata=new String[200][50000];
  public String[] subx=new String[50000];
  public String title,author;  
  public int[] subnumber=new int[200];
 
    public static void main(String[] args) {
        pro test=new pro();
    }
 
    pro(){
 
        int tr;
        for(tr=1;tr<1201;tr++){
 
         String urlx="http://nananovels.blog118.fc2.com/blog-entry-"+tr+".html";
 
          getdata sub=new getdata();
   sub.makedata(urlx,"UTF-8");
   data=sub.data;
   datanumber=sub.datanumber;
 
   title="";
  for(s=1;s<datanumber+1;s++){
if(data[s].indexOf("kizi_title")>-1) title=data[s];
   }
 
  title=change(title);
 
   int s1=0;
 
   for(s=1;s<datanumber+1;s++){
   int h=0;
   if(data[s].indexOf("entry_body")>-1)h=h+1;    
   if(s1==0)h=h+1; 
   if(h==2)s1=s;
   }
 
   int s2=0;
   for(s=s1+1;s<datanumber+1;s++){
   int h=0;
   if(data[s].indexOf("<style>")>-1)h=h+1;    
   if(s2==0)h=h+1; 
   if(h==2)s2=s;
   }
 
 
   int sx=0;
  String str="";
   for(s=s1;s<s2;s++){
   data[s]=change(data[s]);
   str=str+data[s];
    }
 
   str=str.replace("」","」△");
   str=str.replace("     ","△");
    str=str.replace("。","。△");
 String[] x=str.split("△");
 
sx=0;
   for(s=0;s<x.length;s++){
   if(x[s].length()>0)sx=sx+1;
   if(x[s].length()>0)subdata[1][sx]=x[s];
    }
 
   subnumber[1]=sx;
 
   subtitle[1]=title;
 
  if(title.length()>0){
   epub_kadokawa sub2=new epub_kadokawa();
sub2.title=title;
sub2.author="菜々";
sub2.year=28;
sub2.month=12;
sub2.day=9;
sub2.number=1;
sub2.subnumber=subnumber;
sub2.page=subdata;
sub2.subtitle=subtitle;
sub2.makedata("book/"+title+".kepub.epub");
   }   
 
 
        }
 
 
 
    }
     String change(String str){
 
        int n;
        for(n=1;n<51;n++){
        str=rev(str);    
        }
 
 
        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;
    }     
 
 
 
}
最終更新:2016年12月09日 08:15