📜 ⬆️ ⬇️

Get product information from Amazon via API

Amazon.com is not only a huge store, but also free legal access to a huge amount of information on products. Some time ago, Amazon stopped accepting requests without a signature, the script I wrote signs the request in accordance with the current API requirements. As an example, I want to show how to get information on books through the Amazon API knowing only the ISBN number.

To get started, you need to register on aws.amazon.com . Then you get access to your account, in which you need to pay attention to the “Access Identifiers” tab. For the script to work correctly, you need to copy two parameters “Your Access Key ID” and “Your Secret Access Key”. After that, insert these identifiers into the corresponding lines of the script. As a result, the script will receive information on the book in XML format. Which, you can use on your own.

For more information about the parameters that you can pass to the API, you can read on the Amazon website here.

Copy Source | Copy HTML <?php $info = getBookInfo( '1591409268' , _access_key, _secure_access_key); print $info ; function getBookInfo( $isbn , $access_key , $secure_access_key ) { // $fields = array (); $fields [ 'AWSAccessKeyId' ] = $access_key ; $fields [ 'ItemId' ] = $isbn ; $fields [ 'MerchantId' ] = 'All' ; $fields [ 'Operation' ] = 'ItemLookup' ; $fields [ 'ResponseGroup' ] = 'Request,Large' ; $fields [ 'Service' ] = 'AWSECommerceService' ; $fields [ 'Version' ] = '2009-01-06' ; $fields [ 'Timestamp' ] = gmdate( 'Ymd\TH:i:s\Z' ); // Amazon API ksort( $fields ); $query = array (); foreach ( $fields as $key => $value ) { $query [] = "$key=" . urlencode( $value ); } // $string = "GET\nwebservices.amazon.com\n/onca/xml\n" . implode( '&' , $query ); $signed = urlencode(base64_encode(hash_hmac( 'sha256' , $string , $secure_access_key , true ))); // $url = 'http://webservices.amazon.com/onca/xml?' . implode( '&' , $query ) . '&Signature=' . $signed ; $ch = curl_init(); curl_setopt( $ch , CURLOPT_URL, $url ); curl_setopt( $ch , CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch , CURLOPT_FOLLOWLOCATION, 1 ); $data = curl_exec( $ch ); $info = curl_getinfo( $ch ); if ( $info [ 'http_code' ] != '200' ) return false ; return $data ; } ?>
  1. Copy Source | Copy HTML <?php $info = getBookInfo( '1591409268' , _access_key, _secure_access_key); print $info ; function getBookInfo( $isbn , $access_key , $secure_access_key ) { // $fields = array (); $fields [ 'AWSAccessKeyId' ] = $access_key ; $fields [ 'ItemId' ] = $isbn ; $fields [ 'MerchantId' ] = 'All' ; $fields [ 'Operation' ] = 'ItemLookup' ; $fields [ 'ResponseGroup' ] = 'Request,Large' ; $fields [ 'Service' ] = 'AWSECommerceService' ; $fields [ 'Version' ] = '2009-01-06' ; $fields [ 'Timestamp' ] = gmdate( 'Ymd\TH:i:s\Z' ); // Amazon API ksort( $fields ); $query = array (); foreach ( $fields as $key => $value ) { $query [] = "$key=" . urlencode( $value ); } // $string = "GET\nwebservices.amazon.com\n/onca/xml\n" . implode( '&' , $query ); $signed = urlencode(base64_encode(hash_hmac( 'sha256' , $string , $secure_access_key , true ))); // $url = 'http://webservices.amazon.com/onca/xml?' . implode( '&' , $query ) . '&Signature=' . $signed ; $ch = curl_init(); curl_setopt( $ch , CURLOPT_URL, $url ); curl_setopt( $ch , CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch , CURLOPT_FOLLOWLOCATION, 1 ); $data = curl_exec( $ch ); $info = curl_getinfo( $ch ); if ( $info [ 'http_code' ] != '200' ) return false ; return $data ; } ?>
  2. Copy Source | Copy HTML <?php $info = getBookInfo( '1591409268' , _access_key, _secure_access_key); print $info ; function getBookInfo( $isbn , $access_key , $secure_access_key ) { // $fields = array (); $fields [ 'AWSAccessKeyId' ] = $access_key ; $fields [ 'ItemId' ] = $isbn ; $fields [ 'MerchantId' ] = 'All' ; $fields [ 'Operation' ] = 'ItemLookup' ; $fields [ 'ResponseGroup' ] = 'Request,Large' ; $fields [ 'Service' ] = 'AWSECommerceService' ; $fields [ 'Version' ] = '2009-01-06' ; $fields [ 'Timestamp' ] = gmdate( 'Ymd\TH:i:s\Z' ); // Amazon API ksort( $fields ); $query = array (); foreach ( $fields as $key => $value ) { $query [] = "$key=" . urlencode( $value ); } // $string = "GET\nwebservices.amazon.com\n/onca/xml\n" . implode( '&' , $query ); $signed = urlencode(base64_encode(hash_hmac( 'sha256' , $string , $secure_access_key , true ))); // $url = 'http://webservices.amazon.com/onca/xml?' . implode( '&' , $query ) . '&Signature=' . $signed ; $ch = curl_init(); curl_setopt( $ch , CURLOPT_URL, $url ); curl_setopt( $ch , CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch , CURLOPT_FOLLOWLOCATION, 1 ); $data = curl_exec( $ch ); $info = curl_getinfo( $ch ); if ( $info [ 'http_code' ] != '200' ) return false ; return $data ; } ?>
  3. Copy Source | Copy HTML <?php $info = getBookInfo( '1591409268' , _access_key, _secure_access_key); print $info ; function getBookInfo( $isbn , $access_key , $secure_access_key ) { // $fields = array (); $fields [ 'AWSAccessKeyId' ] = $access_key ; $fields [ 'ItemId' ] = $isbn ; $fields [ 'MerchantId' ] = 'All' ; $fields [ 'Operation' ] = 'ItemLookup' ; $fields [ 'ResponseGroup' ] = 'Request,Large' ; $fields [ 'Service' ] = 'AWSECommerceService' ; $fields [ 'Version' ] = '2009-01-06' ; $fields [ 'Timestamp' ] = gmdate( 'Ymd\TH:i:s\Z' ); // Amazon API ksort( $fields ); $query = array (); foreach ( $fields as $key => $value ) { $query [] = "$key=" . urlencode( $value ); } // $string = "GET\nwebservices.amazon.com\n/onca/xml\n" . implode( '&' , $query ); $signed = urlencode(base64_encode(hash_hmac( 'sha256' , $string , $secure_access_key , true ))); // $url = 'http://webservices.amazon.com/onca/xml?' . implode( '&' , $query ) . '&Signature=' . $signed ; $ch = curl_init(); curl_setopt( $ch , CURLOPT_URL, $url ); curl_setopt( $ch , CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch , CURLOPT_FOLLOWLOCATION, 1 ); $data = curl_exec( $ch ); $info = curl_getinfo( $ch ); if ( $info [ 'http_code' ] != '200' ) return false ; return $data ; } ?>
  4. Copy Source | Copy HTML <?php $info = getBookInfo( '1591409268' , _access_key, _secure_access_key); print $info ; function getBookInfo( $isbn , $access_key , $secure_access_key ) { // $fields = array (); $fields [ 'AWSAccessKeyId' ] = $access_key ; $fields [ 'ItemId' ] = $isbn ; $fields [ 'MerchantId' ] = 'All' ; $fields [ 'Operation' ] = 'ItemLookup' ; $fields [ 'ResponseGroup' ] = 'Request,Large' ; $fields [ 'Service' ] = 'AWSECommerceService' ; $fields [ 'Version' ] = '2009-01-06' ; $fields [ 'Timestamp' ] = gmdate( 'Ymd\TH:i:s\Z' ); // Amazon API ksort( $fields ); $query = array (); foreach ( $fields as $key => $value ) { $query [] = "$key=" . urlencode( $value ); } // $string = "GET\nwebservices.amazon.com\n/onca/xml\n" . implode( '&' , $query ); $signed = urlencode(base64_encode(hash_hmac( 'sha256' , $string , $secure_access_key , true ))); // $url = 'http://webservices.amazon.com/onca/xml?' . implode( '&' , $query ) . '&Signature=' . $signed ; $ch = curl_init(); curl_setopt( $ch , CURLOPT_URL, $url ); curl_setopt( $ch , CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch , CURLOPT_FOLLOWLOCATION, 1 ); $data = curl_exec( $ch ); $info = curl_getinfo( $ch ); if ( $info [ 'http_code' ] != '200' ) return false ; return $data ; } ?>
  5. Copy Source | Copy HTML <?php $info = getBookInfo( '1591409268' , _access_key, _secure_access_key); print $info ; function getBookInfo( $isbn , $access_key , $secure_access_key ) { // $fields = array (); $fields [ 'AWSAccessKeyId' ] = $access_key ; $fields [ 'ItemId' ] = $isbn ; $fields [ 'MerchantId' ] = 'All' ; $fields [ 'Operation' ] = 'ItemLookup' ; $fields [ 'ResponseGroup' ] = 'Request,Large' ; $fields [ 'Service' ] = 'AWSECommerceService' ; $fields [ 'Version' ] = '2009-01-06' ; $fields [ 'Timestamp' ] = gmdate( 'Ymd\TH:i:s\Z' ); // Amazon API ksort( $fields ); $query = array (); foreach ( $fields as $key => $value ) { $query [] = "$key=" . urlencode( $value ); } // $string = "GET\nwebservices.amazon.com\n/onca/xml\n" . implode( '&' , $query ); $signed = urlencode(base64_encode(hash_hmac( 'sha256' , $string , $secure_access_key , true ))); // $url = 'http://webservices.amazon.com/onca/xml?' . implode( '&' , $query ) . '&Signature=' . $signed ; $ch = curl_init(); curl_setopt( $ch , CURLOPT_URL, $url ); curl_setopt( $ch , CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch , CURLOPT_FOLLOWLOCATION, 1 ); $data = curl_exec( $ch ); $info = curl_getinfo( $ch ); if ( $info [ 'http_code' ] != '200' ) return false ; return $data ; } ?>
  6. Copy Source | Copy HTML <?php $info = getBookInfo( '1591409268' , _access_key, _secure_access_key); print $info ; function getBookInfo( $isbn , $access_key , $secure_access_key ) { // $fields = array (); $fields [ 'AWSAccessKeyId' ] = $access_key ; $fields [ 'ItemId' ] = $isbn ; $fields [ 'MerchantId' ] = 'All' ; $fields [ 'Operation' ] = 'ItemLookup' ; $fields [ 'ResponseGroup' ] = 'Request,Large' ; $fields [ 'Service' ] = 'AWSECommerceService' ; $fields [ 'Version' ] = '2009-01-06' ; $fields [ 'Timestamp' ] = gmdate( 'Ymd\TH:i:s\Z' ); // Amazon API ksort( $fields ); $query = array (); foreach ( $fields as $key => $value ) { $query [] = "$key=" . urlencode( $value ); } // $string = "GET\nwebservices.amazon.com\n/onca/xml\n" . implode( '&' , $query ); $signed = urlencode(base64_encode(hash_hmac( 'sha256' , $string , $secure_access_key , true ))); // $url = 'http://webservices.amazon.com/onca/xml?' . implode( '&' , $query ) . '&Signature=' . $signed ; $ch = curl_init(); curl_setopt( $ch , CURLOPT_URL, $url ); curl_setopt( $ch , CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch , CURLOPT_FOLLOWLOCATION, 1 ); $data = curl_exec( $ch ); $info = curl_getinfo( $ch ); if ( $info [ 'http_code' ] != '200' ) return false ; return $data ; } ?>
  7. Copy Source | Copy HTML <?php $info = getBookInfo( '1591409268' , _access_key, _secure_access_key); print $info ; function getBookInfo( $isbn , $access_key , $secure_access_key ) { // $fields = array (); $fields [ 'AWSAccessKeyId' ] = $access_key ; $fields [ 'ItemId' ] = $isbn ; $fields [ 'MerchantId' ] = 'All' ; $fields [ 'Operation' ] = 'ItemLookup' ; $fields [ 'ResponseGroup' ] = 'Request,Large' ; $fields [ 'Service' ] = 'AWSECommerceService' ; $fields [ 'Version' ] = '2009-01-06' ; $fields [ 'Timestamp' ] = gmdate( 'Ymd\TH:i:s\Z' ); // Amazon API ksort( $fields ); $query = array (); foreach ( $fields as $key => $value ) { $query [] = "$key=" . urlencode( $value ); } // $string = "GET\nwebservices.amazon.com\n/onca/xml\n" . implode( '&' , $query ); $signed = urlencode(base64_encode(hash_hmac( 'sha256' , $string , $secure_access_key , true ))); // $url = 'http://webservices.amazon.com/onca/xml?' . implode( '&' , $query ) . '&Signature=' . $signed ; $ch = curl_init(); curl_setopt( $ch , CURLOPT_URL, $url ); curl_setopt( $ch , CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch , CURLOPT_FOLLOWLOCATION, 1 ); $data = curl_exec( $ch ); $info = curl_getinfo( $ch ); if ( $info [ 'http_code' ] != '200' ) return false ; return $data ; } ?>
  8. Copy Source | Copy HTML <?php $info = getBookInfo( '1591409268' , _access_key, _secure_access_key); print $info ; function getBookInfo( $isbn , $access_key , $secure_access_key ) { // $fields = array (); $fields [ 'AWSAccessKeyId' ] = $access_key ; $fields [ 'ItemId' ] = $isbn ; $fields [ 'MerchantId' ] = 'All' ; $fields [ 'Operation' ] = 'ItemLookup' ; $fields [ 'ResponseGroup' ] = 'Request,Large' ; $fields [ 'Service' ] = 'AWSECommerceService' ; $fields [ 'Version' ] = '2009-01-06' ; $fields [ 'Timestamp' ] = gmdate( 'Ymd\TH:i:s\Z' ); // Amazon API ksort( $fields ); $query = array (); foreach ( $fields as $key => $value ) { $query [] = "$key=" . urlencode( $value ); } // $string = "GET\nwebservices.amazon.com\n/onca/xml\n" . implode( '&' , $query ); $signed = urlencode(base64_encode(hash_hmac( 'sha256' , $string , $secure_access_key , true ))); // $url = 'http://webservices.amazon.com/onca/xml?' . implode( '&' , $query ) . '&Signature=' . $signed ; $ch = curl_init(); curl_setopt( $ch , CURLOPT_URL, $url ); curl_setopt( $ch , CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch , CURLOPT_FOLLOWLOCATION, 1 ); $data = curl_exec( $ch ); $info = curl_getinfo( $ch ); if ( $info [ 'http_code' ] != '200' ) return false ; return $data ; } ?>
  9. Copy Source | Copy HTML <?php $info = getBookInfo( '1591409268' , _access_key, _secure_access_key); print $info ; function getBookInfo( $isbn , $access_key , $secure_access_key ) { // $fields = array (); $fields [ 'AWSAccessKeyId' ] = $access_key ; $fields [ 'ItemId' ] = $isbn ; $fields [ 'MerchantId' ] = 'All' ; $fields [ 'Operation' ] = 'ItemLookup' ; $fields [ 'ResponseGroup' ] = 'Request,Large' ; $fields [ 'Service' ] = 'AWSECommerceService' ; $fields [ 'Version' ] = '2009-01-06' ; $fields [ 'Timestamp' ] = gmdate( 'Ymd\TH:i:s\Z' ); // Amazon API ksort( $fields ); $query = array (); foreach ( $fields as $key => $value ) { $query [] = "$key=" . urlencode( $value ); } // $string = "GET\nwebservices.amazon.com\n/onca/xml\n" . implode( '&' , $query ); $signed = urlencode(base64_encode(hash_hmac( 'sha256' , $string , $secure_access_key , true ))); // $url = 'http://webservices.amazon.com/onca/xml?' . implode( '&' , $query ) . '&Signature=' . $signed ; $ch = curl_init(); curl_setopt( $ch , CURLOPT_URL, $url ); curl_setopt( $ch , CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch , CURLOPT_FOLLOWLOCATION, 1 ); $data = curl_exec( $ch ); $info = curl_getinfo( $ch ); if ( $info [ 'http_code' ] != '200' ) return false ; return $data ; } ?>
  10. Copy Source | Copy HTML <?php $info = getBookInfo( '1591409268' , _access_key, _secure_access_key); print $info ; function getBookInfo( $isbn , $access_key , $secure_access_key ) { // $fields = array (); $fields [ 'AWSAccessKeyId' ] = $access_key ; $fields [ 'ItemId' ] = $isbn ; $fields [ 'MerchantId' ] = 'All' ; $fields [ 'Operation' ] = 'ItemLookup' ; $fields [ 'ResponseGroup' ] = 'Request,Large' ; $fields [ 'Service' ] = 'AWSECommerceService' ; $fields [ 'Version' ] = '2009-01-06' ; $fields [ 'Timestamp' ] = gmdate( 'Ymd\TH:i:s\Z' ); // Amazon API ksort( $fields ); $query = array (); foreach ( $fields as $key => $value ) { $query [] = "$key=" . urlencode( $value ); } // $string = "GET\nwebservices.amazon.com\n/onca/xml\n" . implode( '&' , $query ); $signed = urlencode(base64_encode(hash_hmac( 'sha256' , $string , $secure_access_key , true ))); // $url = 'http://webservices.amazon.com/onca/xml?' . implode( '&' , $query ) . '&Signature=' . $signed ; $ch = curl_init(); curl_setopt( $ch , CURLOPT_URL, $url ); curl_setopt( $ch , CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch , CURLOPT_FOLLOWLOCATION, 1 ); $data = curl_exec( $ch ); $info = curl_getinfo( $ch ); if ( $info [ 'http_code' ] != '200' ) return false ; return $data ; } ?>
  11. Copy Source | Copy HTML <?php $info = getBookInfo( '1591409268' , _access_key, _secure_access_key); print $info ; function getBookInfo( $isbn , $access_key , $secure_access_key ) { // $fields = array (); $fields [ 'AWSAccessKeyId' ] = $access_key ; $fields [ 'ItemId' ] = $isbn ; $fields [ 'MerchantId' ] = 'All' ; $fields [ 'Operation' ] = 'ItemLookup' ; $fields [ 'ResponseGroup' ] = 'Request,Large' ; $fields [ 'Service' ] = 'AWSECommerceService' ; $fields [ 'Version' ] = '2009-01-06' ; $fields [ 'Timestamp' ] = gmdate( 'Ymd\TH:i:s\Z' ); // Amazon API ksort( $fields ); $query = array (); foreach ( $fields as $key => $value ) { $query [] = "$key=" . urlencode( $value ); } // $string = "GET\nwebservices.amazon.com\n/onca/xml\n" . implode( '&' , $query ); $signed = urlencode(base64_encode(hash_hmac( 'sha256' , $string , $secure_access_key , true ))); // $url = 'http://webservices.amazon.com/onca/xml?' . implode( '&' , $query ) . '&Signature=' . $signed ; $ch = curl_init(); curl_setopt( $ch , CURLOPT_URL, $url ); curl_setopt( $ch , CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch , CURLOPT_FOLLOWLOCATION, 1 ); $data = curl_exec( $ch ); $info = curl_getinfo( $ch ); if ( $info [ 'http_code' ] != '200' ) return false ; return $data ; } ?>
  12. Copy Source | Copy HTML <?php $info = getBookInfo( '1591409268' , _access_key, _secure_access_key); print $info ; function getBookInfo( $isbn , $access_key , $secure_access_key ) { // $fields = array (); $fields [ 'AWSAccessKeyId' ] = $access_key ; $fields [ 'ItemId' ] = $isbn ; $fields [ 'MerchantId' ] = 'All' ; $fields [ 'Operation' ] = 'ItemLookup' ; $fields [ 'ResponseGroup' ] = 'Request,Large' ; $fields [ 'Service' ] = 'AWSECommerceService' ; $fields [ 'Version' ] = '2009-01-06' ; $fields [ 'Timestamp' ] = gmdate( 'Ymd\TH:i:s\Z' ); // Amazon API ksort( $fields ); $query = array (); foreach ( $fields as $key => $value ) { $query [] = "$key=" . urlencode( $value ); } // $string = "GET\nwebservices.amazon.com\n/onca/xml\n" . implode( '&' , $query ); $signed = urlencode(base64_encode(hash_hmac( 'sha256' , $string , $secure_access_key , true ))); // $url = 'http://webservices.amazon.com/onca/xml?' . implode( '&' , $query ) . '&Signature=' . $signed ; $ch = curl_init(); curl_setopt( $ch , CURLOPT_URL, $url ); curl_setopt( $ch , CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch , CURLOPT_FOLLOWLOCATION, 1 ); $data = curl_exec( $ch ); $info = curl_getinfo( $ch ); if ( $info [ 'http_code' ] != '200' ) return false ; return $data ; } ?>
  13. Copy Source | Copy HTML <?php $info = getBookInfo( '1591409268' , _access_key, _secure_access_key); print $info ; function getBookInfo( $isbn , $access_key , $secure_access_key ) { // $fields = array (); $fields [ 'AWSAccessKeyId' ] = $access_key ; $fields [ 'ItemId' ] = $isbn ; $fields [ 'MerchantId' ] = 'All' ; $fields [ 'Operation' ] = 'ItemLookup' ; $fields [ 'ResponseGroup' ] = 'Request,Large' ; $fields [ 'Service' ] = 'AWSECommerceService' ; $fields [ 'Version' ] = '2009-01-06' ; $fields [ 'Timestamp' ] = gmdate( 'Ymd\TH:i:s\Z' ); // Amazon API ksort( $fields ); $query = array (); foreach ( $fields as $key => $value ) { $query [] = "$key=" . urlencode( $value ); } // $string = "GET\nwebservices.amazon.com\n/onca/xml\n" . implode( '&' , $query ); $signed = urlencode(base64_encode(hash_hmac( 'sha256' , $string , $secure_access_key , true ))); // $url = 'http://webservices.amazon.com/onca/xml?' . implode( '&' , $query ) . '&Signature=' . $signed ; $ch = curl_init(); curl_setopt( $ch , CURLOPT_URL, $url ); curl_setopt( $ch , CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch , CURLOPT_FOLLOWLOCATION, 1 ); $data = curl_exec( $ch ); $info = curl_getinfo( $ch ); if ( $info [ 'http_code' ] != '200' ) return false ; return $data ; } ?>
  14. Copy Source | Copy HTML <?php $info = getBookInfo( '1591409268' , _access_key, _secure_access_key); print $info ; function getBookInfo( $isbn , $access_key , $secure_access_key ) { // $fields = array (); $fields [ 'AWSAccessKeyId' ] = $access_key ; $fields [ 'ItemId' ] = $isbn ; $fields [ 'MerchantId' ] = 'All' ; $fields [ 'Operation' ] = 'ItemLookup' ; $fields [ 'ResponseGroup' ] = 'Request,Large' ; $fields [ 'Service' ] = 'AWSECommerceService' ; $fields [ 'Version' ] = '2009-01-06' ; $fields [ 'Timestamp' ] = gmdate( 'Ymd\TH:i:s\Z' ); // Amazon API ksort( $fields ); $query = array (); foreach ( $fields as $key => $value ) { $query [] = "$key=" . urlencode( $value ); } // $string = "GET\nwebservices.amazon.com\n/onca/xml\n" . implode( '&' , $query ); $signed = urlencode(base64_encode(hash_hmac( 'sha256' , $string , $secure_access_key , true ))); // $url = 'http://webservices.amazon.com/onca/xml?' . implode( '&' , $query ) . '&Signature=' . $signed ; $ch = curl_init(); curl_setopt( $ch , CURLOPT_URL, $url ); curl_setopt( $ch , CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch , CURLOPT_FOLLOWLOCATION, 1 ); $data = curl_exec( $ch ); $info = curl_getinfo( $ch ); if ( $info [ 'http_code' ] != '200' ) return false ; return $data ; } ?>
  15. Copy Source | Copy HTML <?php $info = getBookInfo( '1591409268' , _access_key, _secure_access_key); print $info ; function getBookInfo( $isbn , $access_key , $secure_access_key ) { // $fields = array (); $fields [ 'AWSAccessKeyId' ] = $access_key ; $fields [ 'ItemId' ] = $isbn ; $fields [ 'MerchantId' ] = 'All' ; $fields [ 'Operation' ] = 'ItemLookup' ; $fields [ 'ResponseGroup' ] = 'Request,Large' ; $fields [ 'Service' ] = 'AWSECommerceService' ; $fields [ 'Version' ] = '2009-01-06' ; $fields [ 'Timestamp' ] = gmdate( 'Ymd\TH:i:s\Z' ); // Amazon API ksort( $fields ); $query = array (); foreach ( $fields as $key => $value ) { $query [] = "$key=" . urlencode( $value ); } // $string = "GET\nwebservices.amazon.com\n/onca/xml\n" . implode( '&' , $query ); $signed = urlencode(base64_encode(hash_hmac( 'sha256' , $string , $secure_access_key , true ))); // $url = 'http://webservices.amazon.com/onca/xml?' . implode( '&' , $query ) . '&Signature=' . $signed ; $ch = curl_init(); curl_setopt( $ch , CURLOPT_URL, $url ); curl_setopt( $ch , CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch , CURLOPT_FOLLOWLOCATION, 1 ); $data = curl_exec( $ch ); $info = curl_getinfo( $ch ); if ( $info [ 'http_code' ] != '200' ) return false ; return $data ; } ?>
  16. Copy Source | Copy HTML <?php $info = getBookInfo( '1591409268' , _access_key, _secure_access_key); print $info ; function getBookInfo( $isbn , $access_key , $secure_access_key ) { // $fields = array (); $fields [ 'AWSAccessKeyId' ] = $access_key ; $fields [ 'ItemId' ] = $isbn ; $fields [ 'MerchantId' ] = 'All' ; $fields [ 'Operation' ] = 'ItemLookup' ; $fields [ 'ResponseGroup' ] = 'Request,Large' ; $fields [ 'Service' ] = 'AWSECommerceService' ; $fields [ 'Version' ] = '2009-01-06' ; $fields [ 'Timestamp' ] = gmdate( 'Ymd\TH:i:s\Z' ); // Amazon API ksort( $fields ); $query = array (); foreach ( $fields as $key => $value ) { $query [] = "$key=" . urlencode( $value ); } // $string = "GET\nwebservices.amazon.com\n/onca/xml\n" . implode( '&' , $query ); $signed = urlencode(base64_encode(hash_hmac( 'sha256' , $string , $secure_access_key , true ))); // $url = 'http://webservices.amazon.com/onca/xml?' . implode( '&' , $query ) . '&Signature=' . $signed ; $ch = curl_init(); curl_setopt( $ch , CURLOPT_URL, $url ); curl_setopt( $ch , CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch , CURLOPT_FOLLOWLOCATION, 1 ); $data = curl_exec( $ch ); $info = curl_getinfo( $ch ); if ( $info [ 'http_code' ] != '200' ) return false ; return $data ; } ?>
  17. Copy Source | Copy HTML <?php $info = getBookInfo( '1591409268' , _access_key, _secure_access_key); print $info ; function getBookInfo( $isbn , $access_key , $secure_access_key ) { // $fields = array (); $fields [ 'AWSAccessKeyId' ] = $access_key ; $fields [ 'ItemId' ] = $isbn ; $fields [ 'MerchantId' ] = 'All' ; $fields [ 'Operation' ] = 'ItemLookup' ; $fields [ 'ResponseGroup' ] = 'Request,Large' ; $fields [ 'Service' ] = 'AWSECommerceService' ; $fields [ 'Version' ] = '2009-01-06' ; $fields [ 'Timestamp' ] = gmdate( 'Ymd\TH:i:s\Z' ); // Amazon API ksort( $fields ); $query = array (); foreach ( $fields as $key => $value ) { $query [] = "$key=" . urlencode( $value ); } // $string = "GET\nwebservices.amazon.com\n/onca/xml\n" . implode( '&' , $query ); $signed = urlencode(base64_encode(hash_hmac( 'sha256' , $string , $secure_access_key , true ))); // $url = 'http://webservices.amazon.com/onca/xml?' . implode( '&' , $query ) . '&Signature=' . $signed ; $ch = curl_init(); curl_setopt( $ch , CURLOPT_URL, $url ); curl_setopt( $ch , CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch , CURLOPT_FOLLOWLOCATION, 1 ); $data = curl_exec( $ch ); $info = curl_getinfo( $ch ); if ( $info [ 'http_code' ] != '200' ) return false ; return $data ; } ?>
  18. Copy Source | Copy HTML <?php $info = getBookInfo( '1591409268' , _access_key, _secure_access_key); print $info ; function getBookInfo( $isbn , $access_key , $secure_access_key ) { // $fields = array (); $fields [ 'AWSAccessKeyId' ] = $access_key ; $fields [ 'ItemId' ] = $isbn ; $fields [ 'MerchantId' ] = 'All' ; $fields [ 'Operation' ] = 'ItemLookup' ; $fields [ 'ResponseGroup' ] = 'Request,Large' ; $fields [ 'Service' ] = 'AWSECommerceService' ; $fields [ 'Version' ] = '2009-01-06' ; $fields [ 'Timestamp' ] = gmdate( 'Ymd\TH:i:s\Z' ); // Amazon API ksort( $fields ); $query = array (); foreach ( $fields as $key => $value ) { $query [] = "$key=" . urlencode( $value ); } // $string = "GET\nwebservices.amazon.com\n/onca/xml\n" . implode( '&' , $query ); $signed = urlencode(base64_encode(hash_hmac( 'sha256' , $string , $secure_access_key , true ))); // $url = 'http://webservices.amazon.com/onca/xml?' . implode( '&' , $query ) . '&Signature=' . $signed ; $ch = curl_init(); curl_setopt( $ch , CURLOPT_URL, $url ); curl_setopt( $ch , CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch , CURLOPT_FOLLOWLOCATION, 1 ); $data = curl_exec( $ch ); $info = curl_getinfo( $ch ); if ( $info [ 'http_code' ] != '200' ) return false ; return $data ; } ?>
  19. Copy Source | Copy HTML <?php $info = getBookInfo( '1591409268' , _access_key, _secure_access_key); print $info ; function getBookInfo( $isbn , $access_key , $secure_access_key ) { // $fields = array (); $fields [ 'AWSAccessKeyId' ] = $access_key ; $fields [ 'ItemId' ] = $isbn ; $fields [ 'MerchantId' ] = 'All' ; $fields [ 'Operation' ] = 'ItemLookup' ; $fields [ 'ResponseGroup' ] = 'Request,Large' ; $fields [ 'Service' ] = 'AWSECommerceService' ; $fields [ 'Version' ] = '2009-01-06' ; $fields [ 'Timestamp' ] = gmdate( 'Ymd\TH:i:s\Z' ); // Amazon API ksort( $fields ); $query = array (); foreach ( $fields as $key => $value ) { $query [] = "$key=" . urlencode( $value ); } // $string = "GET\nwebservices.amazon.com\n/onca/xml\n" . implode( '&' , $query ); $signed = urlencode(base64_encode(hash_hmac( 'sha256' , $string , $secure_access_key , true ))); // $url = 'http://webservices.amazon.com/onca/xml?' . implode( '&' , $query ) . '&Signature=' . $signed ; $ch = curl_init(); curl_setopt( $ch , CURLOPT_URL, $url ); curl_setopt( $ch , CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch , CURLOPT_FOLLOWLOCATION, 1 ); $data = curl_exec( $ch ); $info = curl_getinfo( $ch ); if ( $info [ 'http_code' ] != '200' ) return false ; return $data ; } ?>
  20. Copy Source | Copy HTML <?php $info = getBookInfo( '1591409268' , _access_key, _secure_access_key); print $info ; function getBookInfo( $isbn , $access_key , $secure_access_key ) { // $fields = array (); $fields [ 'AWSAccessKeyId' ] = $access_key ; $fields [ 'ItemId' ] = $isbn ; $fields [ 'MerchantId' ] = 'All' ; $fields [ 'Operation' ] = 'ItemLookup' ; $fields [ 'ResponseGroup' ] = 'Request,Large' ; $fields [ 'Service' ] = 'AWSECommerceService' ; $fields [ 'Version' ] = '2009-01-06' ; $fields [ 'Timestamp' ] = gmdate( 'Ymd\TH:i:s\Z' ); // Amazon API ksort( $fields ); $query = array (); foreach ( $fields as $key => $value ) { $query [] = "$key=" . urlencode( $value ); } // $string = "GET\nwebservices.amazon.com\n/onca/xml\n" . implode( '&' , $query ); $signed = urlencode(base64_encode(hash_hmac( 'sha256' , $string , $secure_access_key , true ))); // $url = 'http://webservices.amazon.com/onca/xml?' . implode( '&' , $query ) . '&Signature=' . $signed ; $ch = curl_init(); curl_setopt( $ch , CURLOPT_URL, $url ); curl_setopt( $ch , CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch , CURLOPT_FOLLOWLOCATION, 1 ); $data = curl_exec( $ch ); $info = curl_getinfo( $ch ); if ( $info [ 'http_code' ] != '200' ) return false ; return $data ; } ?>
  21. Copy Source | Copy HTML <?php $info = getBookInfo( '1591409268' , _access_key, _secure_access_key); print $info ; function getBookInfo( $isbn , $access_key , $secure_access_key ) { // $fields = array (); $fields [ 'AWSAccessKeyId' ] = $access_key ; $fields [ 'ItemId' ] = $isbn ; $fields [ 'MerchantId' ] = 'All' ; $fields [ 'Operation' ] = 'ItemLookup' ; $fields [ 'ResponseGroup' ] = 'Request,Large' ; $fields [ 'Service' ] = 'AWSECommerceService' ; $fields [ 'Version' ] = '2009-01-06' ; $fields [ 'Timestamp' ] = gmdate( 'Ymd\TH:i:s\Z' ); // Amazon API ksort( $fields ); $query = array (); foreach ( $fields as $key => $value ) { $query [] = "$key=" . urlencode( $value ); } // $string = "GET\nwebservices.amazon.com\n/onca/xml\n" . implode( '&' , $query ); $signed = urlencode(base64_encode(hash_hmac( 'sha256' , $string , $secure_access_key , true ))); // $url = 'http://webservices.amazon.com/onca/xml?' . implode( '&' , $query ) . '&Signature=' . $signed ; $ch = curl_init(); curl_setopt( $ch , CURLOPT_URL, $url ); curl_setopt( $ch , CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch , CURLOPT_FOLLOWLOCATION, 1 ); $data = curl_exec( $ch ); $info = curl_getinfo( $ch ); if ( $info [ 'http_code' ] != '200' ) return false ; return $data ; } ?>
  22. Copy Source | Copy HTML <?php $info = getBookInfo( '1591409268' , _access_key, _secure_access_key); print $info ; function getBookInfo( $isbn , $access_key , $secure_access_key ) { // $fields = array (); $fields [ 'AWSAccessKeyId' ] = $access_key ; $fields [ 'ItemId' ] = $isbn ; $fields [ 'MerchantId' ] = 'All' ; $fields [ 'Operation' ] = 'ItemLookup' ; $fields [ 'ResponseGroup' ] = 'Request,Large' ; $fields [ 'Service' ] = 'AWSECommerceService' ; $fields [ 'Version' ] = '2009-01-06' ; $fields [ 'Timestamp' ] = gmdate( 'Ymd\TH:i:s\Z' ); // Amazon API ksort( $fields ); $query = array (); foreach ( $fields as $key => $value ) { $query [] = "$key=" . urlencode( $value ); } // $string = "GET\nwebservices.amazon.com\n/onca/xml\n" . implode( '&' , $query ); $signed = urlencode(base64_encode(hash_hmac( 'sha256' , $string , $secure_access_key , true ))); // $url = 'http://webservices.amazon.com/onca/xml?' . implode( '&' , $query ) . '&Signature=' . $signed ; $ch = curl_init(); curl_setopt( $ch , CURLOPT_URL, $url ); curl_setopt( $ch , CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch , CURLOPT_FOLLOWLOCATION, 1 ); $data = curl_exec( $ch ); $info = curl_getinfo( $ch ); if ( $info [ 'http_code' ] != '200' ) return false ; return $data ; } ?>
  23. Copy Source | Copy HTML <?php $info = getBookInfo( '1591409268' , _access_key, _secure_access_key); print $info ; function getBookInfo( $isbn , $access_key , $secure_access_key ) { // $fields = array (); $fields [ 'AWSAccessKeyId' ] = $access_key ; $fields [ 'ItemId' ] = $isbn ; $fields [ 'MerchantId' ] = 'All' ; $fields [ 'Operation' ] = 'ItemLookup' ; $fields [ 'ResponseGroup' ] = 'Request,Large' ; $fields [ 'Service' ] = 'AWSECommerceService' ; $fields [ 'Version' ] = '2009-01-06' ; $fields [ 'Timestamp' ] = gmdate( 'Ymd\TH:i:s\Z' ); // Amazon API ksort( $fields ); $query = array (); foreach ( $fields as $key => $value ) { $query [] = "$key=" . urlencode( $value ); } // $string = "GET\nwebservices.amazon.com\n/onca/xml\n" . implode( '&' , $query ); $signed = urlencode(base64_encode(hash_hmac( 'sha256' , $string , $secure_access_key , true ))); // $url = 'http://webservices.amazon.com/onca/xml?' . implode( '&' , $query ) . '&Signature=' . $signed ; $ch = curl_init(); curl_setopt( $ch , CURLOPT_URL, $url ); curl_setopt( $ch , CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch , CURLOPT_FOLLOWLOCATION, 1 ); $data = curl_exec( $ch ); $info = curl_getinfo( $ch ); if ( $info [ 'http_code' ] != '200' ) return false ; return $data ; } ?>
  24. Copy Source | Copy HTML <?php $info = getBookInfo( '1591409268' , _access_key, _secure_access_key); print $info ; function getBookInfo( $isbn , $access_key , $secure_access_key ) { // $fields = array (); $fields [ 'AWSAccessKeyId' ] = $access_key ; $fields [ 'ItemId' ] = $isbn ; $fields [ 'MerchantId' ] = 'All' ; $fields [ 'Operation' ] = 'ItemLookup' ; $fields [ 'ResponseGroup' ] = 'Request,Large' ; $fields [ 'Service' ] = 'AWSECommerceService' ; $fields [ 'Version' ] = '2009-01-06' ; $fields [ 'Timestamp' ] = gmdate( 'Ymd\TH:i:s\Z' ); // Amazon API ksort( $fields ); $query = array (); foreach ( $fields as $key => $value ) { $query [] = "$key=" . urlencode( $value ); } // $string = "GET\nwebservices.amazon.com\n/onca/xml\n" . implode( '&' , $query ); $signed = urlencode(base64_encode(hash_hmac( 'sha256' , $string , $secure_access_key , true ))); // $url = 'http://webservices.amazon.com/onca/xml?' . implode( '&' , $query ) . '&Signature=' . $signed ; $ch = curl_init(); curl_setopt( $ch , CURLOPT_URL, $url ); curl_setopt( $ch , CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch , CURLOPT_FOLLOWLOCATION, 1 ); $data = curl_exec( $ch ); $info = curl_getinfo( $ch ); if ( $info [ 'http_code' ] != '200' ) return false ; return $data ; } ?>
  25. Copy Source | Copy HTML <?php $info = getBookInfo( '1591409268' , _access_key, _secure_access_key); print $info ; function getBookInfo( $isbn , $access_key , $secure_access_key ) { // $fields = array (); $fields [ 'AWSAccessKeyId' ] = $access_key ; $fields [ 'ItemId' ] = $isbn ; $fields [ 'MerchantId' ] = 'All' ; $fields [ 'Operation' ] = 'ItemLookup' ; $fields [ 'ResponseGroup' ] = 'Request,Large' ; $fields [ 'Service' ] = 'AWSECommerceService' ; $fields [ 'Version' ] = '2009-01-06' ; $fields [ 'Timestamp' ] = gmdate( 'Ymd\TH:i:s\Z' ); // Amazon API ksort( $fields ); $query = array (); foreach ( $fields as $key => $value ) { $query [] = "$key=" . urlencode( $value ); } // $string = "GET\nwebservices.amazon.com\n/onca/xml\n" . implode( '&' , $query ); $signed = urlencode(base64_encode(hash_hmac( 'sha256' , $string , $secure_access_key , true ))); // $url = 'http://webservices.amazon.com/onca/xml?' . implode( '&' , $query ) . '&Signature=' . $signed ; $ch = curl_init(); curl_setopt( $ch , CURLOPT_URL, $url ); curl_setopt( $ch , CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch , CURLOPT_FOLLOWLOCATION, 1 ); $data = curl_exec( $ch ); $info = curl_getinfo( $ch ); if ( $info [ 'http_code' ] != '200' ) return false ; return $data ; } ?>
  26. Copy Source | Copy HTML <?php $info = getBookInfo( '1591409268' , _access_key, _secure_access_key); print $info ; function getBookInfo( $isbn , $access_key , $secure_access_key ) { // $fields = array (); $fields [ 'AWSAccessKeyId' ] = $access_key ; $fields [ 'ItemId' ] = $isbn ; $fields [ 'MerchantId' ] = 'All' ; $fields [ 'Operation' ] = 'ItemLookup' ; $fields [ 'ResponseGroup' ] = 'Request,Large' ; $fields [ 'Service' ] = 'AWSECommerceService' ; $fields [ 'Version' ] = '2009-01-06' ; $fields [ 'Timestamp' ] = gmdate( 'Ymd\TH:i:s\Z' ); // Amazon API ksort( $fields ); $query = array (); foreach ( $fields as $key => $value ) { $query [] = "$key=" . urlencode( $value ); } // $string = "GET\nwebservices.amazon.com\n/onca/xml\n" . implode( '&' , $query ); $signed = urlencode(base64_encode(hash_hmac( 'sha256' , $string , $secure_access_key , true ))); // $url = 'http://webservices.amazon.com/onca/xml?' . implode( '&' , $query ) . '&Signature=' . $signed ; $ch = curl_init(); curl_setopt( $ch , CURLOPT_URL, $url ); curl_setopt( $ch , CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch , CURLOPT_FOLLOWLOCATION, 1 ); $data = curl_exec( $ch ); $info = curl_getinfo( $ch ); if ( $info [ 'http_code' ] != '200' ) return false ; return $data ; } ?>
  27. Copy Source | Copy HTML <?php $info = getBookInfo( '1591409268' , _access_key, _secure_access_key); print $info ; function getBookInfo( $isbn , $access_key , $secure_access_key ) { // $fields = array (); $fields [ 'AWSAccessKeyId' ] = $access_key ; $fields [ 'ItemId' ] = $isbn ; $fields [ 'MerchantId' ] = 'All' ; $fields [ 'Operation' ] = 'ItemLookup' ; $fields [ 'ResponseGroup' ] = 'Request,Large' ; $fields [ 'Service' ] = 'AWSECommerceService' ; $fields [ 'Version' ] = '2009-01-06' ; $fields [ 'Timestamp' ] = gmdate( 'Ymd\TH:i:s\Z' ); // Amazon API ksort( $fields ); $query = array (); foreach ( $fields as $key => $value ) { $query [] = "$key=" . urlencode( $value ); } // $string = "GET\nwebservices.amazon.com\n/onca/xml\n" . implode( '&' , $query ); $signed = urlencode(base64_encode(hash_hmac( 'sha256' , $string , $secure_access_key , true ))); // $url = 'http://webservices.amazon.com/onca/xml?' . implode( '&' , $query ) . '&Signature=' . $signed ; $ch = curl_init(); curl_setopt( $ch , CURLOPT_URL, $url ); curl_setopt( $ch , CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch , CURLOPT_FOLLOWLOCATION, 1 ); $data = curl_exec( $ch ); $info = curl_getinfo( $ch ); if ( $info [ 'http_code' ] != '200' ) return false ; return $data ; } ?>
  28. Copy Source | Copy HTML <?php $info = getBookInfo( '1591409268' , _access_key, _secure_access_key); print $info ; function getBookInfo( $isbn , $access_key , $secure_access_key ) { // $fields = array (); $fields [ 'AWSAccessKeyId' ] = $access_key ; $fields [ 'ItemId' ] = $isbn ; $fields [ 'MerchantId' ] = 'All' ; $fields [ 'Operation' ] = 'ItemLookup' ; $fields [ 'ResponseGroup' ] = 'Request,Large' ; $fields [ 'Service' ] = 'AWSECommerceService' ; $fields [ 'Version' ] = '2009-01-06' ; $fields [ 'Timestamp' ] = gmdate( 'Ymd\TH:i:s\Z' ); // Amazon API ksort( $fields ); $query = array (); foreach ( $fields as $key => $value ) { $query [] = "$key=" . urlencode( $value ); } // $string = "GET\nwebservices.amazon.com\n/onca/xml\n" . implode( '&' , $query ); $signed = urlencode(base64_encode(hash_hmac( 'sha256' , $string , $secure_access_key , true ))); // $url = 'http://webservices.amazon.com/onca/xml?' . implode( '&' , $query ) . '&Signature=' . $signed ; $ch = curl_init(); curl_setopt( $ch , CURLOPT_URL, $url ); curl_setopt( $ch , CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch , CURLOPT_FOLLOWLOCATION, 1 ); $data = curl_exec( $ch ); $info = curl_getinfo( $ch ); if ( $info [ 'http_code' ] != '200' ) return false ; return $data ; } ?>
  29. Copy Source | Copy HTML <?php $info = getBookInfo( '1591409268' , _access_key, _secure_access_key); print $info ; function getBookInfo( $isbn , $access_key , $secure_access_key ) { // $fields = array (); $fields [ 'AWSAccessKeyId' ] = $access_key ; $fields [ 'ItemId' ] = $isbn ; $fields [ 'MerchantId' ] = 'All' ; $fields [ 'Operation' ] = 'ItemLookup' ; $fields [ 'ResponseGroup' ] = 'Request,Large' ; $fields [ 'Service' ] = 'AWSECommerceService' ; $fields [ 'Version' ] = '2009-01-06' ; $fields [ 'Timestamp' ] = gmdate( 'Ymd\TH:i:s\Z' ); // Amazon API ksort( $fields ); $query = array (); foreach ( $fields as $key => $value ) { $query [] = "$key=" . urlencode( $value ); } // $string = "GET\nwebservices.amazon.com\n/onca/xml\n" . implode( '&' , $query ); $signed = urlencode(base64_encode(hash_hmac( 'sha256' , $string , $secure_access_key , true ))); // $url = 'http://webservices.amazon.com/onca/xml?' . implode( '&' , $query ) . '&Signature=' . $signed ; $ch = curl_init(); curl_setopt( $ch , CURLOPT_URL, $url ); curl_setopt( $ch , CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch , CURLOPT_FOLLOWLOCATION, 1 ); $data = curl_exec( $ch ); $info = curl_getinfo( $ch ); if ( $info [ 'http_code' ] != '200' ) return false ; return $data ; } ?>
  30. Copy Source | Copy HTML <?php $info = getBookInfo( '1591409268' , _access_key, _secure_access_key); print $info ; function getBookInfo( $isbn , $access_key , $secure_access_key ) { // $fields = array (); $fields [ 'AWSAccessKeyId' ] = $access_key ; $fields [ 'ItemId' ] = $isbn ; $fields [ 'MerchantId' ] = 'All' ; $fields [ 'Operation' ] = 'ItemLookup' ; $fields [ 'ResponseGroup' ] = 'Request,Large' ; $fields [ 'Service' ] = 'AWSECommerceService' ; $fields [ 'Version' ] = '2009-01-06' ; $fields [ 'Timestamp' ] = gmdate( 'Ymd\TH:i:s\Z' ); // Amazon API ksort( $fields ); $query = array (); foreach ( $fields as $key => $value ) { $query [] = "$key=" . urlencode( $value ); } // $string = "GET\nwebservices.amazon.com\n/onca/xml\n" . implode( '&' , $query ); $signed = urlencode(base64_encode(hash_hmac( 'sha256' , $string , $secure_access_key , true ))); // $url = 'http://webservices.amazon.com/onca/xml?' . implode( '&' , $query ) . '&Signature=' . $signed ; $ch = curl_init(); curl_setopt( $ch , CURLOPT_URL, $url ); curl_setopt( $ch , CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch , CURLOPT_FOLLOWLOCATION, 1 ); $data = curl_exec( $ch ); $info = curl_getinfo( $ch ); if ( $info [ 'http_code' ] != '200' ) return false ; return $data ; } ?>
  31. Copy Source | Copy HTML <?php $info = getBookInfo( '1591409268' , _access_key, _secure_access_key); print $info ; function getBookInfo( $isbn , $access_key , $secure_access_key ) { // $fields = array (); $fields [ 'AWSAccessKeyId' ] = $access_key ; $fields [ 'ItemId' ] = $isbn ; $fields [ 'MerchantId' ] = 'All' ; $fields [ 'Operation' ] = 'ItemLookup' ; $fields [ 'ResponseGroup' ] = 'Request,Large' ; $fields [ 'Service' ] = 'AWSECommerceService' ; $fields [ 'Version' ] = '2009-01-06' ; $fields [ 'Timestamp' ] = gmdate( 'Ymd\TH:i:s\Z' ); // Amazon API ksort( $fields ); $query = array (); foreach ( $fields as $key => $value ) { $query [] = "$key=" . urlencode( $value ); } // $string = "GET\nwebservices.amazon.com\n/onca/xml\n" . implode( '&' , $query ); $signed = urlencode(base64_encode(hash_hmac( 'sha256' , $string , $secure_access_key , true ))); // $url = 'http://webservices.amazon.com/onca/xml?' . implode( '&' , $query ) . '&Signature=' . $signed ; $ch = curl_init(); curl_setopt( $ch , CURLOPT_URL, $url ); curl_setopt( $ch , CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch , CURLOPT_FOLLOWLOCATION, 1 ); $data = curl_exec( $ch ); $info = curl_getinfo( $ch ); if ( $info [ 'http_code' ] != '200' ) return false ; return $data ; } ?>
  32. Copy Source | Copy HTML <?php $info = getBookInfo( '1591409268' , _access_key, _secure_access_key); print $info ; function getBookInfo( $isbn , $access_key , $secure_access_key ) { // $fields = array (); $fields [ 'AWSAccessKeyId' ] = $access_key ; $fields [ 'ItemId' ] = $isbn ; $fields [ 'MerchantId' ] = 'All' ; $fields [ 'Operation' ] = 'ItemLookup' ; $fields [ 'ResponseGroup' ] = 'Request,Large' ; $fields [ 'Service' ] = 'AWSECommerceService' ; $fields [ 'Version' ] = '2009-01-06' ; $fields [ 'Timestamp' ] = gmdate( 'Ymd\TH:i:s\Z' ); // Amazon API ksort( $fields ); $query = array (); foreach ( $fields as $key => $value ) { $query [] = "$key=" . urlencode( $value ); } // $string = "GET\nwebservices.amazon.com\n/onca/xml\n" . implode( '&' , $query ); $signed = urlencode(base64_encode(hash_hmac( 'sha256' , $string , $secure_access_key , true ))); // $url = 'http://webservices.amazon.com/onca/xml?' . implode( '&' , $query ) . '&Signature=' . $signed ; $ch = curl_init(); curl_setopt( $ch , CURLOPT_URL, $url ); curl_setopt( $ch , CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch , CURLOPT_FOLLOWLOCATION, 1 ); $data = curl_exec( $ch ); $info = curl_getinfo( $ch ); if ( $info [ 'http_code' ] != '200' ) return false ; return $data ; } ?>
  33. Copy Source | Copy HTML <?php $info = getBookInfo( '1591409268' , _access_key, _secure_access_key); print $info ; function getBookInfo( $isbn , $access_key , $secure_access_key ) { // $fields = array (); $fields [ 'AWSAccessKeyId' ] = $access_key ; $fields [ 'ItemId' ] = $isbn ; $fields [ 'MerchantId' ] = 'All' ; $fields [ 'Operation' ] = 'ItemLookup' ; $fields [ 'ResponseGroup' ] = 'Request,Large' ; $fields [ 'Service' ] = 'AWSECommerceService' ; $fields [ 'Version' ] = '2009-01-06' ; $fields [ 'Timestamp' ] = gmdate( 'Ymd\TH:i:s\Z' ); // Amazon API ksort( $fields ); $query = array (); foreach ( $fields as $key => $value ) { $query [] = "$key=" . urlencode( $value ); } // $string = "GET\nwebservices.amazon.com\n/onca/xml\n" . implode( '&' , $query ); $signed = urlencode(base64_encode(hash_hmac( 'sha256' , $string , $secure_access_key , true ))); // $url = 'http://webservices.amazon.com/onca/xml?' . implode( '&' , $query ) . '&Signature=' . $signed ; $ch = curl_init(); curl_setopt( $ch , CURLOPT_URL, $url ); curl_setopt( $ch , CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch , CURLOPT_FOLLOWLOCATION, 1 ); $data = curl_exec( $ch ); $info = curl_getinfo( $ch ); if ( $info [ 'http_code' ] != '200' ) return false ; return $data ; } ?>
  34. Copy Source | Copy HTML <?php $info = getBookInfo( '1591409268' , _access_key, _secure_access_key); print $info ; function getBookInfo( $isbn , $access_key , $secure_access_key ) { // $fields = array (); $fields [ 'AWSAccessKeyId' ] = $access_key ; $fields [ 'ItemId' ] = $isbn ; $fields [ 'MerchantId' ] = 'All' ; $fields [ 'Operation' ] = 'ItemLookup' ; $fields [ 'ResponseGroup' ] = 'Request,Large' ; $fields [ 'Service' ] = 'AWSECommerceService' ; $fields [ 'Version' ] = '2009-01-06' ; $fields [ 'Timestamp' ] = gmdate( 'Ymd\TH:i:s\Z' ); // Amazon API ksort( $fields ); $query = array (); foreach ( $fields as $key => $value ) { $query [] = "$key=" . urlencode( $value ); } // $string = "GET\nwebservices.amazon.com\n/onca/xml\n" . implode( '&' , $query ); $signed = urlencode(base64_encode(hash_hmac( 'sha256' , $string , $secure_access_key , true ))); // $url = 'http://webservices.amazon.com/onca/xml?' . implode( '&' , $query ) . '&Signature=' . $signed ; $ch = curl_init(); curl_setopt( $ch , CURLOPT_URL, $url ); curl_setopt( $ch , CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch , CURLOPT_FOLLOWLOCATION, 1 ); $data = curl_exec( $ch ); $info = curl_getinfo( $ch ); if ( $info [ 'http_code' ] != '200' ) return false ; return $data ; } ?>
  35. Copy Source | Copy HTML <?php $info = getBookInfo( '1591409268' , _access_key, _secure_access_key); print $info ; function getBookInfo( $isbn , $access_key , $secure_access_key ) { // $fields = array (); $fields [ 'AWSAccessKeyId' ] = $access_key ; $fields [ 'ItemId' ] = $isbn ; $fields [ 'MerchantId' ] = 'All' ; $fields [ 'Operation' ] = 'ItemLookup' ; $fields [ 'ResponseGroup' ] = 'Request,Large' ; $fields [ 'Service' ] = 'AWSECommerceService' ; $fields [ 'Version' ] = '2009-01-06' ; $fields [ 'Timestamp' ] = gmdate( 'Ymd\TH:i:s\Z' ); // Amazon API ksort( $fields ); $query = array (); foreach ( $fields as $key => $value ) { $query [] = "$key=" . urlencode( $value ); } // $string = "GET\nwebservices.amazon.com\n/onca/xml\n" . implode( '&' , $query ); $signed = urlencode(base64_encode(hash_hmac( 'sha256' , $string , $secure_access_key , true ))); // $url = 'http://webservices.amazon.com/onca/xml?' . implode( '&' , $query ) . '&Signature=' . $signed ; $ch = curl_init(); curl_setopt( $ch , CURLOPT_URL, $url ); curl_setopt( $ch , CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch , CURLOPT_FOLLOWLOCATION, 1 ); $data = curl_exec( $ch ); $info = curl_getinfo( $ch ); if ( $info [ 'http_code' ] != '200' ) return false ; return $data ; } ?>
  36. Copy Source | Copy HTML <?php $info = getBookInfo( '1591409268' , _access_key, _secure_access_key); print $info ; function getBookInfo( $isbn , $access_key , $secure_access_key ) { // $fields = array (); $fields [ 'AWSAccessKeyId' ] = $access_key ; $fields [ 'ItemId' ] = $isbn ; $fields [ 'MerchantId' ] = 'All' ; $fields [ 'Operation' ] = 'ItemLookup' ; $fields [ 'ResponseGroup' ] = 'Request,Large' ; $fields [ 'Service' ] = 'AWSECommerceService' ; $fields [ 'Version' ] = '2009-01-06' ; $fields [ 'Timestamp' ] = gmdate( 'Ymd\TH:i:s\Z' ); // Amazon API ksort( $fields ); $query = array (); foreach ( $fields as $key => $value ) { $query [] = "$key=" . urlencode( $value ); } // $string = "GET\nwebservices.amazon.com\n/onca/xml\n" . implode( '&' , $query ); $signed = urlencode(base64_encode(hash_hmac( 'sha256' , $string , $secure_access_key , true ))); // $url = 'http://webservices.amazon.com/onca/xml?' . implode( '&' , $query ) . '&Signature=' . $signed ; $ch = curl_init(); curl_setopt( $ch , CURLOPT_URL, $url ); curl_setopt( $ch , CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch , CURLOPT_FOLLOWLOCATION, 1 ); $data = curl_exec( $ch ); $info = curl_getinfo( $ch ); if ( $info [ 'http_code' ] != '200' ) return false ; return $data ; } ?>

')

Source: https://habr.com/ru/post/67365/


All Articles