アットウィキロゴ

あや

package mae;
 
import tool.*; 
import simple.epub;
 
 
 
public class pro {
 
     int s,datanumber;
    String[] data=new String[5000];
     String[] memo=new String[5000];
 
      String[] link=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 sx=0;
        int n;
     for(n=1;n<7;n++){   
 
         String urlx="http://blogs.yahoo.co.jp/ayayakashiwagijp/MYBLOG/yblog.html?m=l&p="+n;
 
          getdata sub3=new getdata();
   sub3.makedata(urlx,"EUC-JP");
   data=sub3.data;
   datanumber=sub3.datanumber;
 
   for(s=1;s<datanumber+1;s++){
   if(data[s].indexOf("icnMembe")>-1)sx=sx+1;   
   if(data[s].indexOf("icnMembe")>-1)link[sx]=data[s];
   }
 
     }
 
        System.out.println(sx);   
 
     n=sx;
 
        int tr;
        for(tr=1;tr<n+1;tr++){
 
 
            int p1=link[tr].indexOf("http");
         int p2=link[tr].indexOf("\"",p1);
 link[tr]=link[tr].substring(p1,p2);
 
          getdata sub=new getdata();
   sub.makedata(link[tr],"EUC-JP");
   data=sub.data;
   datanumber=sub.datanumber;
 
   title="";
  for(s=1;s<datanumber+1;s++){
if(data[s].indexOf("headline")>-1) title=data[s]; 
  }
 
  title=change(title);
 
   int s1=0;
 
   for(s=1;s<datanumber+1;s++){
   int h=0;
   if(data[s].indexOf("articleBody")>-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("/entryBody")>-1)h=h+1;    
   if(s2==0)h=h+1; 
   if(h==2)s2=s;
   }
 
 
 
  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 sub2=new epub();
sub2.title=title;
sub2.author="彩";
sub2.number=1;
sub2.subnumber=subnumber;
sub2.subdata=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年11月04日 01:33