Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Stoyan Stefanov's Blog:
Using PEAR and AWS to keep an eye on Amazon
Jan 11, 2007 @ 12:59:59

On his blog today, Stoyan Stefanov shows how to use a PEAR package - PEAR::Services_Amazon - to "keep an eye on" Amazon's stats for a book.

I wanted to have a page that shows the books I've written, together with their Amazon sales rank and the average customer rating and number of reviews. It's really easy. I took one example out of the PEAR book and slightly modified it.

The script needs to few things to get up and running, so he points out those (an AWS id, the PEAR pacakge) and the simple path the application will take to grab the information (request/response). Then it's on to the actual PHP code - all 60 lines of it, including the HTML for the output.

It makes the request with the Services_Amazon package for the given item numbers (he happened to have already) and pulls the results back, looping through them displaying sales rank, title, author, the average rating, and the number of total customer reviews - all in a handy unordered list.

tagged: amazone pear pacakge servicesamazon salesrank reviews rating amazone pear pacakge servicesamazon salesrank reviews rating

Link:

Stoyan Stefanov's Blog:
Using PEAR and AWS to keep an eye on Amazon
Jan 11, 2007 @ 12:59:59

On his blog today, Stoyan Stefanov shows how to use a PEAR package - PEAR::Services_Amazon - to "keep an eye on" Amazon's stats for a book.

I wanted to have a page that shows the books I've written, together with their Amazon sales rank and the average customer rating and number of reviews. It's really easy. I took one example out of the PEAR book and slightly modified it.

The script needs to few things to get up and running, so he points out those (an AWS id, the PEAR pacakge) and the simple path the application will take to grab the information (request/response). Then it's on to the actual PHP code - all 60 lines of it, including the HTML for the output.

It makes the request with the Services_Amazon package for the given item numbers (he happened to have already) and pulls the results back, looping through them displaying sales rank, title, author, the average rating, and the number of total customer reviews - all in a handy unordered list.

tagged: amazone pear pacakge servicesamazon salesrank reviews rating amazone pear pacakge servicesamazon salesrank reviews rating

Link:


Trending Topics: