package book;
public class pro {
String a1,t1,str;
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="大阪";
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");
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="+"猫";
urlx=urlx+"&ch="+100;
getdata sub3=new getdata();
sub3.makedata(urlx);
}
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;
}
}
package book;
import java.io.*;
import java.net.URLEncoder;
class rakuten{
String urlx,str1,str2;
void makedata(String author,String title){
urlx="";
try{
str1 = URLEncoder.encode(author,"utf-8");
str2 = URLEncoder.encode(title,"utf-8");
urlx="http://api.rakuten.co.jp/rws/3.0/rest?";
urlx=urlx+"developerId=";
urlx=urlx+"cc7aedb3ecd1a722df68c90e98298864";
urlx=urlx+"&operation=BooksBookSearch";
urlx=urlx+"&version=2011-12-01";
urlx=urlx+"&author=";
urlx=urlx+str1;
urlx=urlx+"&title=";
urlx=urlx+str2;
}catch(Exception e) { System.err.println(e); }
}
}
最終更新:2013年12月14日 09:41