アットウィキロゴ

check

package book;
 
 
public class pro {
 
 
    String a1,t1,str,com;
  String urlx;
    String[] data=new String[50000];
int s,datanumber;
 
String pic,isbn,title,author;
 
    public static void main(String[] args) {
        pro test=new pro();
    }
 
    pro(){
 
 
        a1="城山三郎";
        t1="官僚たちの夏";
        com="テレビも見てみようかな";
 
        rakuten sub=new rakuten();
        sub.makedata(a1,t1);
        urlx=sub.urlx;
 
 
        getdata sub2=new getdata();
        sub2.makedata(urlx);
        data=sub2.data;
        datanumber=sub2.datanumber;
 
        str="";
  for(s=1;s<datanumber+1;s++){
  str=str+data[s];
  }
 
  pic=catchword(str,"largeImageUrl");
  isbn=catchword(str,"isbn");
  title=catchword(str,"title");
  author=catchword(str,"author");
 
 
  int ch;
 
  ch=check(isbn);
 
  System.out.println(ch);      
 
  if(ch<60)line();
 
 
 
    }
 
    String catchword(String str,String word){
 
        int p1,p2;
        String w1,w2,strx;
        w1="<"+word+">";
        w2="</"+word+">";
 
        p1=str.indexOf(w1);
        p2=str.indexOf(w2);
       strx="noname";
        if(p1>-1)strx=str.substring(p1,p2);
        strx=strx.replace(w1,"");
 
 
        return strx;
 
    }
 
    void line(){
 
 
        urlx="http://musicland.netii.net/book/book.php?";
        urlx=urlx+"a="+author;
        urlx=urlx+"&t="+title;
        urlx=urlx+"&p="+pic;
        urlx=urlx+"&i="+isbn;
        urlx=urlx+"&co="+com;
        urlx=urlx+"&ch="+100;
 
        getdata sub4=new getdata();
        sub4.makedata(urlx);
 
 
 
    }
 
 
    int check(String isb){
 
        String urlx,str,strx;
         String[] data=new String[50000];
int s,datanumber;
        int n;
 
      urlx="http://musicland.netii.net/book/check.php?";
        urlx=urlx+"i="+isbn;
 
        getdata sub3=new getdata();
        sub3.makedata(urlx);
        data=sub3.data;
        datanumber=sub3.datanumber;
 
        str="";
        for(s=1;s<datanumber+1;s++){
       str=str+data[s];
        }
 
 
 
        int p1;
        p1=str.indexOf("<");
 
        strx="0";
        if(p1>-1)strx=str.substring(0,p1);
        n=Integer.parseInt(strx);  
 
    return n;    
 
    }
 
}
 
最終更新:2013年12月14日 10:12