ISBN-search

"; //紀伊國屋書店 $knk="http://bookweb.kinokuniya.co.jp/guest/cgi-bin/wshosea.cgi?W-ISBN=".$isbn; $knkinfo = file_get_contents($knk); $knkinfo = mb_convert_encoding($knkinfo, "UTF-8", "SJIS"); if (ereg ("該当データはありません",$knkinfo)){ echo "

【紀伊國屋書店】

該当データはありません。

"; }else{ $knkstrt=strpos($knkinfo,""); if (ereg ("在庫がございます",$knkinfo)){ $knkend = strpos($knkinfo,"",$knkstrt); $zk0 = strpos($knkinfo,"
  • ",$knkend); $zk1 = strpos($knkinfo,"
    ",$zk0); $zaiko = strip_tags(substr($knkinfo,$zk0,$zk1-$zk0)); if(ereg("この商品は現在予約受付中です。",$knkinfo)){ $zaiko = "この商品は現在予約受付中です。"; } $zaiko .= "
    "; $desc0 = strpos($knkinfo,"

    詳細

    "); $desc1 = strpos($knkinfo,"",$desc0); $desc = strip_tags(substr($knkinfo,$desc0,$desc1-$desc0)); $knkbook = substr($knkinfo,$knkstrt,$knkend-$knkstrt-21); $knkbook = ereg_replace("
    ","』",$knkbook); $knkbook = ereg_replace("
    |

    |

    ||","",$knkbook); $knkbook = ereg_replace("\./wshosea.cgi\?W-FAUTH","http://ck.jp.ap.valuecommerce.com/servlet/referral?sid=2213365&pid=873154756&vc_url=http://bookweb.kinokuniya.co.jp/guest/cgi-bin/wshosea.cgi%3fW-FAUTH",$knkbook); $knkbook = ereg_replace("』 ISBN",$knkbook); echo "

    【紀伊國屋書店】

    "; echo $knkbook."
    ".$zaiko.$desc."

    \n"; } } //bk1 $bk1url="http://www.bk1.jp/webap/user/SchDetailBibList.do?isbn=".$isbn; $bk1 = file_get_contents($bk1url); if (ereg("該当するデータがありません。",$bk1)){ echo "

    【bk1】

    該当するデータがありません。

    "; }else{ $pos_id = strpos($bk1,"name=\"bibId\""); $bk1id = substr($bk1,$pos_id+20,7); $pos1 = strpos($bk1,"

    "); $pos2 = strpos($bk1,"

    ",$pos1); $title = strip_tags(substr($bk1,$pos1,$pos2-$pos1)); $pos6 = strpos($bk1,"

    内容説明

    "); if($pos6){$pos7 = strpos($bk1,"",$pos6); $description = strip_tags(substr($bk1,$pos6,$pos7-$pos6)); } echo "

    【bk1】

    "; echo "

    ".$title."
    "; echo "".$description."

    "; } //Amazon.co.jp echo "

    【Amazon.co.jp】

    \n"; function amzuri($asin) { $params = array(); $params['Service'] = "AWSECommerceService"; $params['AWSAccessKeyId'] = "0HA30CHFKA8AR774MT82"; $params['Version'] = "2009-03-31"; $params['Operation'] = "ItemLookup"; $params['Timestamp'] = gmdate('Y-m-d\TH:i:s\Z'); $params['ItemId'] = $asin; $params['ResponseGroup'] = "Medium,Offers"; $params['AssociateTag'] = "tolleetlege0d-22"; ksort($params); $canonical_string = ''; foreach ($params as $k => $v) { $canonical_string .= '&'.rawurlencode($k).'='.rawurlencode($v); } $canonical_string = substr($canonical_string, 1); $baseurl = "http://ecs.amazonaws.jp/onca/xml"; $SecretKey = "9NCxTJfeeeNlZhE4S3KOKhJhTtsq/mNJXK5Rry35"; $parsed_url = parse_url($baseurl); $string_to_sign = "GET\n{$parsed_url['host']}\n{$parsed_url['path']}\n{$canonical_string}"; $signature = base64_encode(hash_hmac('sha256', $string_to_sign, $SecretKey, true)); $amzurl = $baseurl.'?'.$canonical_string.'&Signature='.rawurlencode($signature); return $amzurl; } $getamz = amzuri($asin); $res = simplexml_load_file($getamz); foreach($res->Items->Item as $item){ $avbl = $item->Offers->Offer->OfferListing->Availability; $dpURL = $item->DetailPageURL; $author = $item->ItemAttributes->Author; $author = ereg_replace(" ","",$author); $title = $item->ItemAttributes->Title; $title = ereg_replace("\(|\)","",$title); $pubdate = $item->ItemAttributes->PublicationDate; $publisher = $item->ItemAttributes->Publisher; $price = $item->ItemAttributes->ListPrice->Amount; echo "

    ".$author." 『".$title."
    "; echo $publisher."(".$pubdate.")".$price."[".$avbl."]

    \n"; } //ジュンク堂書店 $junk="http://www.junkudo.co.jp/search2.jsp?ARGS=".$isbn."&VIEW=isbn&x=0&y=0"; $junkinfo = file_get_contents($junk); $junkinfo = mb_convert_encoding($junkinfo, "UTF-8", "SJIS"); if (ereg ("該当する本は有りません。",$junkinfo)){ echo "

    【ジュンク堂書店】

    該当する本は有りません。

    "; }else{ //$start=strpos($junkinfo,""); $jnk_book = substr($junkinfo,$start,$end-$start); $jnk_book = ereg_replace("href=detail2","href='http://www.junkudo.co.jp/detail2",$jnk_book); $jnk_book = ereg_replace(" class=\"lLink\"","'",$jnk_book); $jnk_book = ereg_replace("href=view2","href='http://www.junkudo.co.jp/view2",$jnk_book); $jnk_book = ereg_replace("
    ","版",$jnk_book); $jnk_book = ereg_replace("","444444>",$jnk_book); $jnk_book = ereg_replace("
    ","
    ",$jnk_book); $jnk_book = "

    ".$jnk_book; echo "

    【ジュンク堂書店】

    "; echo $jnk_book."

    \n\n"; } //楽天 $rktnurl = "http://api.rakuten.co.jp/rws/2.0/rest?developerId=a2a447ceafdac4ff22921e283353e47d&operation=BooksBookSearch&version=2009-04-15&affiliateId=0404662e.58760b07.0404662f.e3580286&isbn=".$isbn; $rktnfile = file_get_contents($rktnurl); $rktnfile = str_replace('header:Header', 'Header', $rktnfile); $rktnfile = str_replace('booksBookSearch:BooksBookSearch', 'BooksBookSearch', $rktnfile); $xml = simplexml_load_string($rktnfile); $rktnaffurl = $xml->Body->BooksBookSearch->Items->Item->affiliateUrl; $rktn_title = $xml->Body->BooksBookSearch->Items->Item->title; $rktn_author = $xml->Body->BooksBookSearch->Items->Item->author; $rktn_publisher = $xml->Body->BooksBookSearch->Items->Item->publisherName; $rktn_desc = $xml->Body->BooksBookSearch->Items->Item->itemCaption; $rktn_date = $xml->Body->BooksBookSearch->Items->Item->salesDate; $rktn_price = $xml->Body->BooksBookSearch->Items->Item->itemPrice; echo "

    【楽天ブックス】

    "; echo "

    ".$rktn_author."『 ".$title."
    "; echo $rktn_publisher."(.$rktn_date.)".$rktn_price."円
    \n"; echo $rktn_desc."

    \n\n"; /* $urlybks="http://books.yahoo.co.jp/book_search/isbn?os=1&isbn=".$asin; $ybks = file_get_contents($urlybks); $ybks = mb_convert_encoding($ybks, "UTF-8", "EUC-JP"); if (ereg("一致する書籍はありませんでした。",$ybks)){ echo "

    セブンアンドワイ

    検索した結果、一致する書籍はありませんでした。

    "; }else{ $ybks = ereg_replace("","QQQQ",$ybks); $ybks = ereg_replace("","QQQQ",$ybks); $ybks = ereg_replace("","QQQQ",$ybks); $ybks = ereg_replace("","QQQQ",$ybks); $ybks = ereg_replace("","QQQQ",$ybks); $ybks = ereg_replace("","QQQQ",$ybks); $ybks = ereg_replace("","QQQQ",$ybks); $ybks = ereg_replace("","QQQQ",$ybks); $ybook = explode("QQQQ",$ybks); $title = strip_tags($ybook[2]); $author = strip_tags($ybook[3]); $publisher = strip_tags($ybook[4]); $pubdate = strip_tags($ybook[5]); $price = strip_tags($ybook[6]); $isbn = strip_tags($ybook[7]); $idstrt = strpos($ybks,"images/i"); $yhbid = substr($ybks,$idstrt+10,8); $title = ereg_replace("書籍名","",$title); $author = ereg_replace("著者名","著者:",$author); $publisher = ereg_replace("出版社名","",$publisher); $pubdate = ereg_replace("発行年月","発行年月:",$pubdate); $price = ereg_replace("価格","価格:",$price); $isbn = ereg_replace("ISBNコード","ISBN: ",$isbn); echo "

    セブンアンドワイ

    \n"; echo "

    ".$title."
    \n"; echo $author."/".$publisher."/".$pubdate."/".$price."/".$isbn."

    \n"; } */ echo "
    "; }else{ if ($len==13 && (substr($isbn,0,4)==9780|9781)){ $isbn13 = $isbn; $asin = substr($isbn,3,9); $nos = str_split($asin,1); $prod = $nos[0]*10+$nos[1]*9+$nos[2]*8+$nos[3]*7+$nos[4]*6+$nos[5]*5+$nos[6]*4+$nos[7]*3+$nos[8]*2; for($i=0;$i<=10;$i++){ $amari = fmod($prod+$i,11); if($amari==0){ $x=0; break; } } if($i==10){ $x='X'; }else{ $x=$i; } $isbn=$asin.$x; }else{ $isbn10 = $isbn; $isbn12 = "978".substr($isbn10,0,9); $num = str_split($isbn12,1); $odds = 0; $evens = 0; for($i=0;$i<12;$i=$i+2){ $odds=$odds+$num[$i]; } for($j=1;$j<12;$j=$j+2){ $evens=$evens+$num[$j]; } $check=$evens*3+$odds; $chknos=str_split($check,1); $last=array_pop($chknos); if($last==0){ $x='0'; }else{ $x=10-$last; } $isbn13=substr($isbn12,0,12).$x; } $country=substr($isbn,0,1); if ($country==4){ $amz_jp="http://webservices.amazon.co.jp/onca/xml?Service=AWSECommerceService&SubscriptionId=08P1RM6HJB7Y13J15BG2&AssociateTag=tolleetlege0d-22&Operation=ItemLookup&IdType=ASIN&ItemId=".$isbn."&ResponseGroup=Medium,Offers"; $jpxml = file_get_contents($amz_jp); // Webサービス実行 $jp_xs = simplexml_load_string($jpxml); // SimpleXMLオブジェクトに変換 $error = $jp_xs->Items->Request->Errors->Error->Code; if ($error=="AWS.InvalidParameterValue"){ echo "

    【Amazon.co.jp】

    "; echo $jp_xs->Items->Request->Errors->Error->Message."

    "; }else{ echo ""; echo "

    【Amazon.co.jp】

    "; echo $jp_xs->Items->Item->ItemAttributes->Title; echo ""; $creators=$jp_xs->Items->Item->ItemAttributes->Creator; foreach ($creators as $values){ echo $values; echo "/"; } echo $jp_xs->Items->Item->ItemAttributes->PublicationDate; echo "刊:"; echo $jp_xs->Items->Item->ItemAttributes->Publisher; echo "/"; echo $jp_xs->Items->Item->ItemAttributes->ListPrice->FormattedPrice; echo "("; echo $jp_xs->Items->Item->Offers->Offer->OfferListing->Availability; echo ")

    \n\n"; } $junk="http://www.junkudo.co.jp/search2.jsp?ARGS=".$isbn."&VIEW=isbn&x=0&y=0"; $junkinfo = file_get_contents($junk); $junkinfo = mb_convert_encoding($junkinfo, "UTF-8", "SJIS"); if (ereg ("該当する本は有りません。",$junkinfo)){ echo "

    【ジュンク堂書店】

    該当する本は有りません。

    "; }else{ $start=strpos($junkinfo,""); $jnk_book = substr($junkinfo,$start,$end-$start); $jnk_book = ereg_replace("href=detail2","href='http://www.junkudo.co.jp/detail2",$jnk_book); $jnk_book = ereg_replace(" class=\"lLink\"","'",$jnk_book); $jnk_book = ereg_replace("href=view2","href='http://www.junkudo.co.jp/view2",$jnk_book); $jnk_book = ereg_replace("
    ","版",$jnk_book); $jnk_book = ereg_replace("","444444>",$jnk_book); $jnk_book = ereg_replace("
    ","
    ",$jnk_book); $jnk_book = "

    ".$jnk_book; echo "

    【ジュンク堂書店】

    "; echo $jnk_book."

    \n\n"; } $knk="http://bookweb.kinokuniya.co.jp/guest/cgi-bin/wshosea.cgi?W-ISBN=".$isbn; $knkinfo = file_get_contents($knk); $knkinfo = mb_convert_encoding($knkinfo, "UTF-8", "SJIS"); if (ereg ("該当データはありません",$knkinfo)){ echo "

    【紀伊國屋書店】

    該当データはありません。

    "; }else{ $knkstart=stripos($knkinfo,"BookTitle"); if (ereg ("お取り寄せになります",$knkinfo)){ $knkend = strpos($knkinfo,"",$knkstart); }elseif (ereg ("在庫をお届けします",$knkinfo)){ $knkend = strpos($knkinfo,"

    ",$knkstart); }elseif (ereg ("この商品は在庫がございます",$knkinfo)){ $knkend = strpos($knkinfo,"


    ",$knkstart); } $knkbook = substr($knkinfo,$knkstart+10,$knkend-$knkstart-10); $knkbook = ereg_replace("

    ","",$knkbook); $knkbook = ereg_replace("

    ","
    ",$knkbook); $knkbook = ereg_replace("
    ","",$knkbook); $knkbook = ereg_replace("

    ","",$knkbook); $knkbook = ereg_replace("


    ","",$knkbook); $knkbook = eregi_replace("","",$knkbook); $knkbook = ereg_replace("\./wshosea.cgi\?W-FAUTH","http://ck.jp.ap.valuecommerce.com/servlet/referral?sid=2213365&pid=873154756&vc_url=http://bookweb.kinokuniya.co.jp/guest/cgi-bin/wshosea.cgi%3fW-FAUTH",$knkbook); $knkbook = ereg_replace("ISBN:","
    』 ISBN",$knkbook); $knkend2 = strpos($knkbook,""); $knkbook = substr($knkbook,0,$knkend2+8); echo "

    【紀伊國屋書店】

    "; echo $knkbook."

    \n"; } $bk1url="http://www.bk1.jp/webap/user/SchDetailBibList.do?isbn=".$isbn13; $bk1 = file_get_contents($bk1url); if (ereg("該当するデータがありません。",$bk1)){ echo "

    【bk1】

    該当するデータがありません。

    "; }else{ $pos_id = strpos($bk1,"http://ping.bk1.jp/tbk.cgi/"); $bk1id = substr($bk1,$pos_id+27,8); $pos1 = strpos($bk1,"

    "); $pos2 = strpos($bk1,"

    ",$pos1); $title = strip_tags(substr($bk1,$pos1,$pos2-$pos1)); $pos4 = strpos($bk1,""); $pos5 = strpos($bk1,""); $info = strip_tags(substr($bk1,$pos4,$pos5-$pos4)); $pos6 = strpos($bk1,"

    内容説明

    "); $pos7 = strpos($bk1,"",$pos6); $description = strip_tags(substr($bk1,$pos6+21,$pos7-$pos6-21)); echo "

    【bk1】

    "; echo "

    $title
    ".$info."
    "; echo "".$description."

    "; } $rktnurl = "http://search.books.rakuten.co.jp/bksearch/nm?sv=30&v=2&oid=000&f=A&g=001&p=0&s=2&e=0&sitem=ISBN%A1%A7".$isbn; $rktn = file_get_contents($rktnurl); $rktn = mb_convert_encoding($rktn, "UTF-8", "EUC-JP"); if (ereg ("全 1件",$rktn)){ $availstrt = strpos($rktn,"-- アイコン --"); $availend = strpos($rktn,"
    ",$availstrt); $availstrt2 = strpos($rktn,"alt=",$availstrt); $availability = substr($rktn,$availstrt2+5,$availend-$availstrt2-7); $titlestrt = strpos($rktn,"-- タイトル --"); $authrstrt = strpos($rktn,"-- 著者など --"); $pricestrt = strpos($rktn,"-- 本体価格 --"); $title = substr($rktn,$titlestrt-2,$authrstrt-$titlestrt); $author = substr($rktn,$authrstrt-2,$pricestrt-$titlestrt); $title = strip_tags($title); $author = strip_tags($author); $idstrt = strpos($rktn,"item.rakuten.co.jp/book/",$titlestrt); $id = substr($rktn,$idstrt+24,7); $url = "http://ck.jp.ap.valuecommerce.com/servlet/referral?sid=2182410&pid=873364320&vc_url=http%3a%2f%2fitem%2erakuten%2eco%2ejp%2fbook%2f".$id; echo "

    【楽天ブックス】

    "; echo "

    ".$title."』[".$availability."]
    "; echo $author."

    "; }else{ echo "

    【楽天ブックス】

    該当する本は有りません。

    "; } $urlybks="http://books.yahoo.co.jp/book_search/isbn?os=1&isbn=".$isbn; $ybks = file_get_contents($urlybks); $ybks = mb_convert_encoding($ybks, "UTF-8", "EUC-JP"); if (ereg("一致する書籍はありませんでした。",$ybks)){ echo "

    セブンアンドワイ

    検索した結果、一致する書籍はありませんでした。

    "; }else{ $ybks = ereg_replace("","QQQQ",$ybks); $ybks = ereg_replace("","QQQQ",$ybks); $ybks = ereg_replace("","QQQQ",$ybks); $ybks = ereg_replace("","QQQQ",$ybks); $ybks = ereg_replace("","QQQQ",$ybks); $ybks = ereg_replace("","QQQQ",$ybks); $ybks = ereg_replace("","QQQQ",$ybks); $ybks = ereg_replace("","QQQQ",$ybks); $ybook = explode("QQQQ",$ybks); $title = strip_tags($ybook[2]); $author = strip_tags($ybook[3]); $publisher = strip_tags($ybook[4]); $pubdate = strip_tags($ybook[5]); $price = strip_tags($ybook[6]); $isbn = strip_tags($ybook[7]); $idstrt = strpos($ybks,"images/i"); $yhbid = substr($ybks,$idstrt+10,8); $title = ereg_replace("書籍名","",$title); $author = ereg_replace("著者名","著者:",$author); $publisher = ereg_replace("出版社名","",$publisher); $pubdate = ereg_replace("発行年月","発行年月:",$pubdate); $price = ereg_replace("価格","価格:",$price); $isbn = ereg_replace("ISBNコード","ISBN: ",$isbn); echo "

    セブンアンドワイ

    \n"; echo "

    ".$title."
    \n"; echo $author."/".$publisher."/".$pubdate."/".$price."/".$isbn."

    \n"; echo "
    "; } }elseif ($country==3){ $amz_jp="http://webservices.amazon.co.jp/onca/xml?Service=AWSECommerceService&SubscriptionId=08P1RM6HJB7Y13J15BG2&AssociateTag=tolleetlege0d-22&Operation=ItemLookup&IdType=ASIN&ItemId=".$isbn."&ResponseGroup=Medium,Offers"; $jpxml = file_get_contents($amz_jp); // Webサービス実行 $jp_xs = simplexml_load_string($jpxml); // SimpleXMLオブジェクトに変換 echo ""; echo "

    【Amazon.co.jp】

    ""; echo $jp_xs->Items->Item->ItemAttributes->Title; echo "" "; $creators=$jp_xs->Items->Item->ItemAttributes->Creator; foreach ($creators as $values){ echo $values; echo "/"; } echo $jp_xs->Items->Item->ItemAttributes->PublicationDate; echo "刊:"; echo $jp_xs->Items->Item->ItemAttributes->Publisher; echo "/"; echo $jp_xs->Items->Item->ItemAttributes->ListPrice->FormattedPrice; echo "("; echo $jp_xs->Items->Item->Offers->Offer->OfferListing->Availability; echo ")

    \n\n"; $amz_de="http://webservices.amazon.de/onca/xml?Service=AWSECommerceService&SubscriptionId=08P1RM6HJB7Y13J15BG2&AssociateTag=tolleetlege01-21&Operation=ItemLookup&IdType=ASIN&ItemId=".$isbn."&ResponseGroup=Medium,Offers"; $dexml = file_get_contents($amz_de); // Webサービス実行 $de_xs = simplexml_load_string($dexml); // SimpleXMLオブジェクトに変換 if ($de_xs->Items->Item->ItemAttributes->Title==""){ echo "

    【Amazon.de】

    Not found.

    "; }else{ echo "

    【Amazon.de】

    ""; echo $de_xs->Items->Item->ItemAttributes->Title; echo "" "; $creators=$de_xs->Items->Item->ItemAttributes->Creator; foreach ($creators as $values){ echo $values; echo "/"; } echo " Erscheinungsdatum: "; echo $de_xs->Items->Item->ItemAttributes->PublicationDate; echo " ("; echo $de_xs->Items->Item->ItemAttributes->Publisher; echo ") "; echo $de_xs->Items->Item->ItemAttributes->ListPrice->FormattedPrice; echo " ("; echo $de_xs->Items->Item->Offers->Offer->OfferListing->Availability; echo ")

    \n\n"; } $amz_uk="http://webservices.amazon.co.uk/onca/xml?Service=AWSECommerceService&SubscriptionId=08P1RM6HJB7Y13J15BG2&AssociateTag=tolleetlege-21&Operation=ItemLookup&IdType=ASIN&ItemId=".$isbn."&ResponseGroup=Medium,Offers"; $ukxml = file_get_contents($amz_uk); // Webサービス実行 $uk_xs = simplexml_load_string($ukxml); // SimpleXMLオブジェクトに変換 if ($uk_xs->Items->Item->ItemAttributes->Title==""){ echo "

    【Amazon.co.uk】

    Not found.

    "; }else{ echo "

    【Amazon.co.uk】

    ""; echo $uk_xs->Items->Item->ItemAttributes->Title; echo "" "; $creators=$uk_xs->Items->Item->ItemAttributes->Creator; foreach ($creators as $values){ echo $values; echo "/"; } echo " Publisher: "; echo $uk_xs->Items->Item->ItemAttributes->Publisher; echo "/ "; echo $uk_xs->Items->Item->ItemAttributes->PublicationDate; echo " Price:"; echo $uk_xs->Items->Item->ItemAttributes->ListPrice->FormattedPrice; echo " ("; echo $uk_xs->Items->Item->Offers->Offer->OfferListing->Availability; echo ")

    \n\n"; } $amz_fr="http://webservices.amazon.fr/onca/xml?Service=AWSECommerceService&SubscriptionId=08P1RM6HJB7Y13J15BG2&AssociateTag=tolleetlege07-21&Operation=ItemLookup&IdType=ASIN&ItemId=".$isbn."&ResponseGroup=Medium,Offers"; $frxml = file_get_contents($amz_fr); // Webサービス実行 $fr_xs = simplexml_load_string($frxml); // SimpleXMLオブジェクトに変換 if ($fr_xs->Items->Item->ItemAttributes->Title==""){ echo "

    【Amazon.fr】

    Not found.

    "; }else{ echo "

    【Amazon.fr】

    ""; echo $fr_xs->Items->Item->ItemAttributes->Title; echo "" "; $creators=$fr_xs->Items->Item->ItemAttributes->Creator; foreach ($creators as $values){ echo $values; echo "/"; } echo $fr_xs->Items->Item->ItemAttributes->PublicationDate; echo " ("; echo $fr_xs->Items->Item->ItemAttributes->Publisher; echo ") "; echo $fr_xs->Items->Item->ItemAttributes->ListPrice->FormattedPrice; echo "Notre prix : "; echo $fr_xs->Items->Item->Offers->Offer->OfferListing->Availability; echo "

    \n\n"; $knurl = "http://bookweb.kinokuniya.co.jp/guest/cgi-bin/booksea.cgi?ISBN=".$isbn; $knfile = file_get_contents($knurl); $knfile = mb_convert_encoding($knfile,"UTF-8","SJIS"); $knfile = ereg_replace("\x0D\x0A|\x0D|\x0A","\n",$knfile); if(ereg("1 matches",$knfile)){ if(ereg("(Not Available)",$knfile)){ echo "

    【紀伊國屋書店】

    "; echo "

    入手不能(Not Available)

    \n"; }else{ $start = strpos($knfile,"1 matches"); $strt0 = strpos($knfile,"",$start); $endpos = strpos($knfile,"",$strt0); $res = strip_tags(substr($knfile,$strt0,$endpos-$strt0)); $res = ereg_replace("Table of Contents","",$res); $res = ereg_replace("Qty.\n","",$res); $res = ereg_replace("\n\n\n\n","",$res); $res = ereg_replace("\n\n","
    \n",$res); $res = ereg_replace("\n\n","",$res); $res = ereg_replace("ISBN:","==aa==ISBN:",$res); $res = " ".$res; $res = ereg_replace("==aa==ISBN"," ISBN",$res); echo "

    【紀伊國屋書店】

    "; echo $res; echo "

    "; } } //} } echo "
    "; }elseif($country==2){ $amz_fr="http://webservices.amazon.fr/onca/xml?Service=AWSECommerceService&SubscriptionId=08P1RM6HJB7Y13J15BG2&AssociateTag=tolleetlege07-21&Operation=ItemLookup&IdType=ASIN&ItemId=".$isbn."&ResponseGroup=Medium,Offers"; $frxml = file_get_contents($amz_fr); // Webサービス実行 $fr_xs = simplexml_load_string($frxml); // SimpleXMLオブジェクトに変換 if ($fr_xs->Items->Item->ItemAttributes->Title==""){ echo "

    【Amazon.fr】

    Not found.

    "; }else{ echo ""; echo "

    【Amazon.fr】

    ""; echo $fr_xs->Items->Item->ItemAttributes->Title; echo "" "; $creators=$fr_xs->Items->Item->ItemAttributes->Creator; foreach ($creators as $values){ echo $values; echo "/"; } echo $fr_xs->Items->Item->ItemAttributes->PublicationDate; echo " ("; echo $fr_xs->Items->Item->ItemAttributes->Publisher; echo ") Notre prix : "; echo $fr_xs->Items->Item->ItemAttributes->ListPrice->FormattedPrice; echo " ["; echo $fr_xs->Items->Item->Offers->Offer->OfferListing->Availability; echo "]

    \n\n"; $knk="http://bookweb.kinokuniya.co.jp/guest/cgi-bin/cfbooksea.cgi?ISBN=".$isbn; $knkinfo = file_get_contents($knk); $knkinfo = mb_convert_encoding($knkinfo, "UTF-8", "SJIS"); if (ereg ("該当データはありません",$knkinfo)){ echo "

    【紀伊國屋書店】

    該当データはありません。

    "; }else{ $knkstart=strpos($knkinfo,""); $knkend = strpos($knkinfo,""); $knkbook = substr($knkinfo,$knkstart+16,$knkend-$knkstart-16); $knkbook = ereg_replace("
    "); $end = strpos($naboinfo,"button_buy_now.gif"); $info = substr($naboinfo,$start,$end-$start); $info = ereg_replace("
    ","",$info); $info = ereg_replace("
    ","",$info); $info = ereg_replace("class=\"tytul2\" ","",$info); $info = ereg_replace("","",$info); $info = ereg_replace("","",$info); $info = ereg_replace(""," ",$info); $info = ereg_replace("",$ibsinfo); $ibs1 = ereg_replace("","",$ibs[0]); $ibs1 = ereg_replace("","",$ibs1); $ibs1 = ereg_replace("","",$ibs1); $ibs1 = ereg_replace("",$ibs2); $ibs3 = ereg_replace("",$forlag0); $trykket0 = strpos($haugeninfo,"Trykket:"); $trykket1 = strpos($haugeninfo,"",$trykket0); $status0 = strpos($haugeninfo,"Status:"); $status1 = strpos($haugeninfo,"",$status0); $title = substr($haugeninfo,$ttlstrt+13,$ttlend-$ttlstrt-13); $author = substr($haugeninfo,$austrt,$ausend-$austrt); $author = ereg_replace("","",$author); $forlag = substr($haugeninfo,$forlag0,$forlag1-$forlag0); $trykket = substr($haugeninfo,$trykket0,$trykket1-$trykket0); $status = substr($haugeninfo,$status0,$status1-$status0); echo "

    Haugen Bok

    "; echo "

    ".$title."
    "; echo $author."
    "; echo strip_tags($forlag)."
    "; echo $trykket."
    "; echo $status."

    "; echo "
    "; } }else{ $country3=substr($isbn,0,3); if ($country3==986 or $country3==957){ $kingstone_url="http://search.kingstone.com.tw/search/searcher.exe?p=&p2=&p3=&p5=&p9=".$isbn."&h=10&l=0&o=&a=25&f=0&t=0&q=&e=&n=&s=1&r=1&z=1&page=10&fileaut=&filename=&filetype=&rel_start=1&rel_num=10&sim_start=1&sim_num=10&property=&property=&partner="; $kingstone = file_get_contents($kingstone_url); $kingstone = mb_convert_encoding($kingstone, "UTF-8", "BIG5");; if (!ereg ("", $kingstone)){ echo "找不到您所查詢的".$isbn."資料!
    "; }else{ $ttlstrt = strpos($kingstone,"
    \"\" \"\"","",$knkbook); $knkbook = ereg_replace("","",$knkbook); $knkbook = ereg_replace("

    ","
    ",$knkbook); $knkbook = ereg_replace("
    ","",$knkbook); $knkbook = ereg_replace("

    ","",$knkbook); $knkbook = ereg_replace("


    ","",$knkbook); $knkbook = eregi_replace("","",$knkbook); $knkbook = eregi_replace("","",$knkbook); $knkbook = eregi_replace("
    ","",$knkbook); $knkbook = eregi_replace("","",$knkbook); $knkbook = eregi_replace("","",$knkbook); $knkbook = eregi_replace("","",$knkbook); $knkbook = eregi_replace("
    ","",$knkbook); $knkbook = eregi_replace("","",$knkbook); $knkbook = eregi_replace("","",$knkbook); $knkbook = eregi_replace("form action=\"/guest/cgi-bin/bagadd.cgi\" method=\"post\">","",$knkbook); $knkbook = eregi_replace("","",$knkbook); $knkbook = eregi_replace("a href=\"/guest/cgi-bin/cfbooksea.cgi","a href=\"http://bookweb.kinokuniya.co.jp/guest/cgi-bin/cfbooksea.cgi",$knkbook); $knkbook = eregi_replace("<<","",$knkbook); $knkbook = ereg_replace("ISBN:","" ISBN",$knkbook); echo "

    【紀伊國屋書店】

    ""; echo $knkbook."

    \n\n"; } } echo "
    "; }elseif ($country==5){ $bru_url="http://www.books.ru/shop/search?search_type=books+&query=".$isbn; $bru_res = file_get_contents($bru_url); $bru_res = mb_convert_encoding($bru_res,"UTF-8","WINDOWS-1251"); $id_strt = strpos($bru_res,"books_o&bi"); $id = substr($bru_res,$id_strt+11,6); $id = ereg_replace("%22","",$id); $ttl_strt = strpos($bru_res,"

    "); $title = substr($bru_res,$ttl_strt,$ttl_end-$ttl_strt+5); echo "".$title.""; $au_strt = strpos($bru_res,"/shop/authors/"); $au_end = strpos($bru_res,""); $author = substr($bru_res,$au_strt,$au_end-$au_strt); echo "    "; $pr_strt = strpos($bru_res,"цена : "); $pr_end = strpos($bru_res," руб"); $price = "    ".substr($bru_res,$pr_strt,$pr_end-$pr_strt+15); echo strip_tags($price)."
    "; $data_strt = strpos($bru_res,"издательство:"); $data_end = strpos($bru_res, "ISBN 5-"); $data=substr($bru_res,$data_strt,$data_end-$data_strt); echo "    ".strip_tags($data); echo "

    "; echo "
    RusKniga"; echo " / Ozon.ru"; echo " / Books.Ru
    "; echo "
    "; } elseif ($country<=1){ $amz_jp="http://webservices.amazon.co.jp/onca/xml?Service=AWSECommerceService&SubscriptionId=08P1RM6HJB7Y13J15BG2&AssociateTag=tolleetlege-20&Operation=ItemLookup&IdType=ASIN&ItemId=".$isbn."&ResponseGroup=Medium,Offers"; $jpxml = file_get_contents($amz_jp); // Webサービス実行 $jp_xs = simplexml_load_string($jpxml); // SimpleXMLオブジェクトに変換 if ($jp_xs->Items->Item->ItemAttributes->Title==""){ echo "

    【Amazon.co.jp】

    Not found.

    "; }else{ echo ""; echo "

    【Amazon.co.jp】

    ""; echo $jp_xs->Items->Item->ItemAttributes->Title; echo "" "; $creators=$jp_xs->Items->Item->ItemAttributes->Creator; foreach ($creators as $values){ echo $values; echo "/"; } echo $jp_xs->Items->Item->ItemAttributes->PublicationDate; echo "刊:"; echo $jp_xs->Items->Item->ItemAttributes->Publisher; echo "/"; echo $jp_xs->Items->Item->ItemAttributes->ListPrice->FormattedPrice; echo "("; echo $jp_xs->Items->Item->Offers->Offer->OfferListing->Availability; echo ")

    \n\n"; } $amz_us="http://webservices.amazon.com/onca/xml?Service=AWSECommerceService&SubscriptionId=08P1RM6HJB7Y13J15BG2&AssociateTag=tolleetlege-20&Operation=ItemLookup&IdType=ASIN&ItemId=".$isbn."&ResponseGroup=Medium,Offers"; $usxml = file_get_contents($amz_us); // Webサービス実行 $us_xs = simplexml_load_string($usxml); // SimpleXMLオブジェクトに変換 if ($us_xs->Items->Item->ItemAttributes->Title==""){ echo "

    【Amazon.com】

    Not found.

    "; }else{ echo "

    【Amazon.com】

    ""; echo $us_xs->Items->Item->ItemAttributes->Title; echo "" "; $creators=$us_xs->Items->Item->ItemAttributes->Creator; foreach ($creators as $values){ echo $values; echo "/"; } echo " Publisher: "; echo $us_xs->Items->Item->ItemAttributes->Publisher; echo "/ "; echo $us_xs->Items->Item->ItemAttributes->PublicationDate; echo " Price:"; echo $us_xs->Items->Item->ItemAttributes->ListPrice->FormattedPrice; echo " ("; echo $us_xs->Items->Item->Offers->Offer->OfferListing->Availability; echo ")

    \n\n"; } $amz_uk="http://webservices.amazon.co.uk/onca/xml?Service=AWSECommerceService&SubscriptionId=08P1RM6HJB7Y13J15BG2&AssociateTag=tolleetlege-21&Operation=ItemLookup&IdType=ASIN&ItemId=".$isbn."&ResponseGroup=Medium,Offers"; $ukxml = file_get_contents($amz_uk); // Webサービス実行 $uk_xs = simplexml_load_string($ukxml); // SimpleXMLオブジェクトに変換 if ($uk_xs->Items->Item->ItemAttributes->Title==""){ echo "

    【Amazon.co.uk】

    Not found.

    "; }else{ echo "

    【Amazon.co.uk】

    ""; echo $uk_xs->Items->Item->ItemAttributes->Title; echo "" "; $creators=$uk_xs->Items->Item->ItemAttributes->Creator; foreach ($creators as $values){ echo $values; echo "/"; } echo " Publisher: "; echo $uk_xs->Items->Item->ItemAttributes->Publisher; echo "/ "; echo $uk_xs->Items->Item->ItemAttributes->PublicationDate; echo " Price:"; echo $uk_xs->Items->Item->ItemAttributes->ListPrice->FormattedPrice; echo " ("; echo $uk_xs->Items->Item->Offers->Offer->OfferListing->Availability; echo ")

    \n\n"; } $pw_url="http://www.powells.com/biblio/".$isbn; $pw_res = file_get_contents($pw_url); $ttl_strt = strpos($pw_res,"font-size: 18px"); $ttl_end = strpos($pw_res,"",$ttl_strt); $title = substr($pw_res,$ttl_strt+18,$ttl_end-$ttl_strt-18); $austart = strpos($pw_res,"author="); $austop = strpos($pw_res,"\">",$austart); $author = substr($pw_res,$austart+7,$austop-$austart-7); $pu_strt = strpos($pw_res,"
    Publisher:
    "); //$publisher = substr($pw_res,$pu_strt); $pu_end = strpos($publisher,""); $publisher = substr($publisher,0,$pu_end); if (ereg("Publication Date:",$pw_res)){ $date_strt = strpos($pw_res,"Publication Date:"); $date_end = strpos($pw_res,"
    Binding:
    "); $date = substr($pw_res,$date_strt,$date_end-$date_strt); } if (ereg("
    ",$pw_res)){ $price_strt = strpos($pw_res,"
    "); $price = substr($pw_res,$price_strt); $price_end = strpos($price,"
    "); $price = substr($price,0,$price_end); } if (ereg("Check for availability",$pw_res)){ $avail2 = " [Check for availability] "; }else{ $avl_strt = strpos($pw_res,"
    "); $avl_end = strpos($pw_res,"
    "); $avail = substr($pw_res,$avl_strt,$avl_end-$avl_strt); } if (ereg("Powell's Books",$publisher)){ echo "

    Powells.com

    "; echo "

    Your search resulted in no matches.

    "; }else{ echo "

    【Powells.com】

    "; echo "

    "; echo $title." by ".$author."
    "; echo strip_tags($publisher)."/ "; echo "Price: ".strip_tags($price).": "; echo strip_tags($date)." ("; echo $avail2; echo strip_tags($avail).")

    "; echo "
    "; } $knurl = "http://bookweb.kinokuniya.co.jp/guest/cgi-bin/booksea.cgi?ISBN=".$isbn; $knfile = file_get_contents($knurl); $knfile = mb_convert_encoding($knfile,"UTF-8","SJIS"); $knfile = ereg_replace("\x0D\x0A|\x0D|\x0A","\n",$knfile); if(ereg("1 matches",$knfile)){ if(ereg("(Not Available)",$knfile)){ echo "

    【紀伊國屋書店】

    "; echo "

    入手不能(Not Available)

    \n"; }else{ $start = strpos($knfile,"1 matches"); $strt0 = strpos($knfile,"
    ",$start); $endpos = strpos($knfile,"
    ",$strt0); $res = strip_tags(substr($knfile,$strt0,$endpos-$strt0)); $res = ereg_replace("Table of Contents","",$res); $res = ereg_replace("Qty.\n","",$res); $res = ereg_replace("\n\n\n\n","",$res); $res = ereg_replace("\n\n","
    \n",$res); $res = ereg_replace("\n\n","",$res); $res = ereg_replace("ISBN:","==aa==ISBN:",$res); $res = " ".$res; $res = ereg_replace("==aa==ISBN"," ISBN",$res); echo "

    【紀伊國屋書店】

    "; echo $res; echo "

    "; } echo "
    "; } $abe_url = "http://www.abebooks.com/servlet/SearchResults?sts=t&y=8&isbn=".$isbn; $abfile = file_get_contents($abe_url); $abfile = utf8_encode($abfile); $abfile = ereg_replace("\x0D\x0A|\x0D|\x0A","\n",$abfile); if(ereg("\(Displaying result",$abfile)){ $mtpos = strpos($abfile,"
    "); $mtend = strpos($abfile,"",$mtpos); $match = chop(substr($abfile,$mtpos,$mtend-$mtpos)); $items = explode("",$abfile); array_shift($items); echo "

    "; echo ""; echo "【AbeBooks.com】"; echo "

    \n"; echo $match."\n"; echo "

    "; $abeno = 1; foreach($items as $item){ $endpt = strpos($item,"

    "); $item = substr($item,0,$endpt); $item = strip_tags($item); $item = preg_replace("/\s+/"," ",$item); $item = preg_replace("/\[Convert Currency\]/","",$item); $epos = strpos($item,"Bookseller Inventory"); $item = substr($item,0,$epos); echo $item; echo "
    \n"; $abeno++; if ($abeno==5){ echo "4件のみ表示"; echo " → 全部見る\n"; break;} } echo "


    "; } }else{ $country2=substr($isbn,0,2); if ($country2==83){ $nabo="http://www.nabo.pl/wynik.php?keywords=".$isbn; $naboinfo = file_get_contents($nabo); $naboinfo = mb_convert_encoding($naboinfo,"UTF-8","iso-8859-2"); if (ereg ("nie pasuje", $naboinfo)){ echo "Żadna z pozycji nie pasuje do kryterium wyszukiwania.
    "; }else{ $start = strpos($naboinfo,"
    ","",$info); $info = ereg_replace("","",$info); $info = ereg_replace("","",$info); $info = ereg_replace("images/male/","http://www.nabo.pl/images/male/",$info); $info = ereg_replace("Nabo.pl】"; echo "
    ".$info."
    "; echo "
    "; } }elseif ($country2==84){ $es_url="http://www.books-world.com/index.php?option=com_commerce&page=advanced_search_result.php&b_i=".$isbn; $es_info = file_get_contents($es_url); $es_info = utf8_encode($es_info); $start = strpos($es_info,"productListing-data\">","",$info); $info = ereg_replace("","",$info); $info = eregi_replace("
    "," ",$info); $info = ereg_replace("
    "," ",$info); echo "

    Alibri Llibreria

    "; echo $info."
    "; $casa_url="http://www.casadellibro.com/busquedas/quickResults/0,,1-i-".$isbn.",00.html?tBusq=i&tValueForSearch=".$isbn."&cFo=true&rOd=&NotQueryAgain=false"; $casa_info = file_get_contents($casa_url); $casa_info = utf8_encode($casa_info); $casastart = strpos($casa_info,"

    1"); $casaend = strpos($casa_info,"€"); $casainfo = substr($casa_info,$casastart+13,$casaend-$casastart-13); $casainfo = ereg_replace("

      ","",$casainfo); $casainfo = ereg_replace("
    • ","",$casainfo); $casainfo = ereg_replace("

      "," ",$casainfo); $casainfo = ereg_replace("

      de","de",$casainfo); $casainfo = ereg_replace("

      ","",$casainfo); $casainfo = ereg_replace("

      "," ",$casainfo); $casainfo = eregi_replace("/fichas/","http://www.casadellibro.com/fichas/",$casainfo); echo "

      casadelibro.com

      "; echo $casainfo."€
      "; } elseif($country2==88){ $ibs_url="http://www.internetbookshop.it/ser/serdsp.asp?isbn=".$isbn; $ibs_info = file_get_contents($ibs_url); $ibs_info = utf8_encode($ibs_info); $ibsstart = strpos($ibs_info,"Titolo"); $ibsinfo = substr($ibs_info,$ibsstart); $ibs = split("
    ","",$ibs1); $ibs1 = ereg_replace("
    ","",$ibs1); $ibs1 = ereg_replace("","
    ",$ibs1); $link = ""; $ibs1 = ereg_replace("",$link,$ibs1); $ibs1 = ereg_replace("","",$ibs1); $ibs1 = ereg_replace("Titolo","Titolo: ",$ibs1); $ibs1 = ereg_replace("Autore","Autore: ",$ibs1); $ibs2 = ereg_replace("
    ",": ",$ibs[1]); $ibs2 = ereg_replace("
    ","",$ibs2); $ibs2 = ereg_replace("
    ","
    ",$ibs2); $ibs2 = ereg_replace("
    "," ",$ibs2); $ibs2 = ereg_replace("
    Dati","
    Dati: ",$ibs2); $ibs2 = ereg_replace("
    Anno","/ Anno: ",$ibs2); $ibs2 = ereg_replace("
    Editore","/ Editore: ",$ibs2); $ibs2 = ereg_replace("\">","\">",$ibs2); $ibs2 = ereg_replace("a href=\"serpge.asp","a href=\"http://www.internetbookshop.it/ser/serpge.asp",$ibs2); $ibs2 = ereg_replace("","",$ibs2); $ibs22 = split("
    Collana","Collana: ",$ibs[2]); $ibs3 = ereg_replace("\">","\">",$ibs3); $ibs3 = ereg_replace("a href=\"serpge.asp","a href=\"http://www.internetbookshop.it/ser/serpge.asp",$ibs3); echo "

    ibs.it

    "; echo $ibs1."

    "; echo $ibs22[0]."
    "; if (!$ibs[3]==""){ echo $ibs3; } echo "
    "; } elseif ($country2==91){ $bokus_url="http://www.bokus.com/cgi-bin/book_search.cgi?FAST=".$isbn."&FAST_VALUE=ISBN"; $bokusinfo = file_get_contents($bokus_url); $bokusinfo = utf8_encode($bokusinfo); $start = strpos($bokusinfo,""); $info = substr($bokusinfo,$start,$end-$start+13); $info = ereg_replace("","",$info); $info = ereg_replace("
    ","
    ",$info); $info = ereg_replace("href=\"/b/","href=\"http://www.bokus.com/b/",$info); $info = ereg_replace("

    ","
    ",$info); echo "

    Bokus

    "; echo "
    ".$info."
    "; echo "
    "; } elseif ($country2==82){ $haugen_url="http://www.haugenbok.no/resultat.cfm?st=simple&isbn=".$isbn; $haugeninfo = file_get_contents($haugen_url); $haugeninfo = utf8_encode($haugeninfo); if (ereg ("Ingen treff", $haugeninfo)){ echo "Not found.
    "; }else{ $ttlstrt = strpos($haugeninfo,"verk-tittel"); $ttlend = strpos($haugeninfo,"",$ttlstrt); if (ereg ("Forfatter:", $haugeninfo)){ $austrt = strpos($haugeninfo,"Forfatter:"); $ausend = strpos($haugeninfo,"",$austrt); }elseif (ereg ("Forfattere:", $haugeninfo)){ $austrt = strpos($haugeninfo,"Forfattere:"); $ausend = strpos($haugeninfo,",
    ",$austrt); } $forlag0 = strpos($haugeninfo,"Forlag:"); $forlag1 = strpos($haugeninfo,"
    ","",$author); $author = ereg_replace("1",$ttlstrt); $title = substr($kingstone,$ttlstrt,$ttlend-$ttlstrt); $title = ereg_replace(">"," target='_blank'>",$title); $title = ereg_replace(" ","",$title); $title = ereg_replace("","",$title); $austrt = strpos($kingstone,""); $auend = strpos($kingstone,"
    ",$austrt); $author = substr($kingstone,$austrt,$auend-$austrt); $author = strip_tags($author); echo "

    金石堂網路書店

    \n"; echo "

    ".$title."
    \n"; echo $author."

    \n"; echo "
    "; } }elseif ($country3==963){ $konyvkereso_url="http://www.konyvkereso.hu/netacgi/konyvker/kereso.pl?zid=11&ln=A&kos=&s1=YDB&pg2=SZER&s2=&op2=same&s3=&op3=and&s4=&op4=and&s5=&op5=and&s6=&op6=and&s7=".$isbn."&op7=and&s8=&op8=and&s9=&s10=&l=5&SECT5=RESZA&d=KERE&p=1&u=%2Fnetahtml%2Fkonyvker%2Fresza.htm&r=0&f=S&ln=A"; $konyvkereso = file_get_contents($konyvkereso_url); $konyvkereso = mb_convert_encoding($konyvkereso, "UTF-8", "iso-8859-1");; if (!ereg ("1 - 1 / 1 hits", $konyvkereso)){ echo "Nincs a feltett keresõkérdésnek megfelelõ bejegyzés !
    "; }else{ $ttlstrt = strpos($konyvkereso,"
    ",$ttlstrt); $title = substr($konyvkereso,$ttlstrt,$ttlend-$ttlstrt); $title = strip_tags($title); $austrt = strpos($konyvkereso,"
    ",$ttlend); $auend = strpos($konyvkereso,"
    ",$austrt); $author = substr($konyvkereso,$austrt,$auend-$austrt); $author = strip_tags($author); echo "

    Könyvkeresõ

    \n"; echo "

    ".$title."

    \n"; echo $author."

    \n"; echo "
    "; } }else{echo "その番号は検索できません。/".$isbn." is not available."; } } } } } ?>