ISBN Lookup from Amazon.com

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
sonicworld
Forum Newbie
Posts: 5
Joined: Thu Aug 04, 2005 6:00 am

ISBN Lookup from Amazon.com

Post by sonicworld »

Can anybody get me a php code to do ISBN lookup from Amazon.com
User avatar
anjanesh
DevNet Resident
Posts: 1679
Joined: Sat Dec 06, 2003 9:52 pm
Location: Mumbai, India

Post by anjanesh »

Code: Select all

$isbn = "0439784549";
$url = "http://www.amazon.com/exec/obidos/tg/detail/-/$isbn";
$contents = file_get_contents($url);
echo $contents;
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

Btw, you might want to take care of sending some extra headers like User-Agent as i seem to remember that amazon.com uses this to determine what is send back..
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

...which means you should probably use cURL
sonicworld
Forum Newbie
Posts: 5
Joined: Thu Aug 04, 2005 6:00 am

Thanks

Post by sonicworld »

Thanks for your reply..

But i would like to retrieve the data from amazon using there webservice.. i want to display the details in my own customized page. can u tell me how to do that? are there any free scripts? or sample scripts?

TIA
User avatar
anjanesh
DevNet Resident
Posts: 1679
Joined: Sat Dec 06, 2003 9:52 pm
Location: Mumbai, India

Post by anjanesh »

sonicworld
Forum Newbie
Posts: 5
Joined: Thu Aug 04, 2005 6:00 am

thanks

Post by sonicworld »

But they dont give any sample php scripts..

can anybody get me some sample php scripts?

TIA
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

Yes, you can. I typed "php amazon webservice" and was returned quite a few classes that can be used.. Or if you feel like doing it over, you can use them as an example..
sonicworld
Forum Newbie
Posts: 5
Joined: Thu Aug 04, 2005 6:00 am

Thanks

Post by sonicworld »

Thanks it really helped..
Post Reply