homepage Welcome to WebmasterWorld Guest from 23.20.220.61
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
Can you get info from amazon by passing just an IBSN
Making amazon AWS script
Archbob




msg:1253474
 8:27 am on Feb 3, 2006 (gmt 0)

I want to create a completely customizable amazon AWS script. I've got this so far:

<snipped personal url, see TOS [webmasterworld.com]>

Now, it is dynamic but the problem is, its not automatically updated along with amazon. You have to manually enter all the info into a form, like price, title, etc. And you have to update them yourself with new prices and such. I couldn't find much in the amazon PHP developer section on amazon.com and I was wondering if there was a way I could just pass a IBSN to the amazon server and retrieve all the results from product info. That would make the script so much better.

I don't just want an RSS feed because I want to specify the exact products I wish to display in the categories which I define(not amazon categories, but categories that I create myself). I haven't found anything in PHP that actually does this.

[edited by: coopster at 2:54 pm (utc) on Feb. 3, 2006]
[edit reason] no personals please [/edit]

 

coopster




msg:1253475
 3:03 pm on Feb 3, 2006 (gmt 0)

Welcome to WebmasterWorld, Archbob.

I'm not certain, but perhaps this relative thread regarding Ebay and Amazon APIs Integration with PHP [webmasterworld.com] will give you some ideas or direction?

niels




msg:1253476
 3:58 pm on Feb 3, 2006 (gmt 0)

The operator for one product is "ItemLookup" you simply enter the isbn or asin and it fetches all data.

The url for that operator would be:

[webservices.amazon.com...]
&AWSAccessKeyId=[Your Access Key ID Here]
&Operation=ItemLookup
&ItemId=[An ASIN]

You should also read the amazon tos, price and availability information cant be older then 24 hours, so if you store it in a db make sure you refresh it every 24 hours.

I hope that helps a bit.

Archbob




msg:1253477
 8:42 pm on Feb 3, 2006 (gmt 0)

I'd just want to display the info straight from amazon. I'm guessing there's no way to do it without an Access Key?

niels




msg:1253478
 8:52 pm on Feb 3, 2006 (gmt 0)

Just get one by creating a account here:

https://aws-portal.amazon.com/gp/aws/developer/registration/index.html

Its free and fruity.

edit: hope linking to amazon aws signup isnt a TOS no-no

Archbob




msg:1253479
 9:45 pm on Feb 3, 2006 (gmt 0)

Ok, I got one and I'm looking at this page now:
[amazon.com...]

However, I see all the parameters except the one I want: Price.

I'm looking at the Response group parameter hoping to find it now. You guys know which parameter it is. Parsing will not be much of a problem one I find the parameter.

niels




msg:1253480
 9:55 pm on Feb 3, 2006 (gmt 0)

Just parse the xml, price data is in there.

[webservices.amazon.com...]
&AWSAccessKeyId=[Your Access Key ID Here]
&Operation=ItemLookup
&ItemId=[An ASIN]

Maybe also look @ the ResponseGroup parameter, that defines the amount of data returned.

Archbob




msg:1253481
 10:04 pm on Feb 3, 2006 (gmt 0)

1M9S1GJNZWK2RPP4Y3FB0.0107078552246094TrueB0009PI6BQB0009PI6BQhttp://www.amazon.com/exec/obidos/redirect?tag=ws%26link_code=xm2%26camp=2025%26creative=165953%26path=http://www.amazon.com/gp/redirect.html%253fASIN=B0009PI6BQ%2526tag=ws%2526lcode=xm2%2526cID=2025%2526ccmID=165953%2526location=/o/ASIN/B0009PI6BQ%25253FSubscriptionId=009KXPFAGB44J3N05Q82Apparel

Thats what you get from the return. The price of the item at hand is $29.99 which is nowhere to be found in the return from file-get-content. I even tried response Large, and still it doesn't always have the price.

niels




msg:1253482
 10:25 pm on Feb 3, 2006 (gmt 0)

Dunno why that feed doesn't contain a price value, try it with another asin, if i remember correctly amazon has 2 price operators ListPrice and OurPrice, so look out for those.

Archbob




msg:1253483
 10:35 pm on Feb 3, 2006 (gmt 0)

Is my method right:
<?php
$var=file_get_contents("http://webservices.amazon.com/onca/xml?Service=AWSECommerceService&AWSAccessKeyId=009KXPFAGB44J3N05Q82&Operation=ItemLookup&ItemId=B0009PI6BQ");
print "$var<br>";
?>

What your seeing is var.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved