Web Development
Talking e-commerce with Amazon.com: Part 1
December 19, 2008 December 19, 2008 It's the holidays and if there's a time to shop it's between "black Friday" and the New Year. I decided it was time to get some e-commerce going one of my own sites, ArtofRhyme.com. The 8.5% referral fee www.Amazon.com offers on certain products is enough to get me to dig into their Web Service aws.amazon.com. Over the next couple of blogs, I'll be taking you through the process of utilizing Amazon's API to pull back information from their servers. I'll be approaching it from the beginning so hopefully people can follow along. One of the first steps to get going with Amazon is to register as a developer https://aws-portal.amazon.com/gp/aws/developer/registration/index.html. If you already have an Amazon account they can federate the information across the two services. I decided to create a new development account because I don't know how much information they share and they have some of my billing information stored. Now that I'm registered, I'm able to check out some of the Developer Resources and one of particular interest is Amazon Associates Web Service Simple Store in PHP http://developer.amazonwebservices.com/connect/entry.jspa?externalID=498&categoryID=14. Sample code is always the best way to learn because it helps to see something working on your own system. Moving into the technology side of this experiment, and, of course, a hiccup: Fatal error: Call to undefined function: simplexml_load_string() in /home/sitename/public_html/SimpleStore.php on line 88 Luckily reading through some comments right on the Simple Store page points me to the culprit. The production server I'm working on is still running PHP 4 and the simplexml_load_string() function was introduced in PHP 5! Version lag is one of the major downfalls of working with a hosted service. Okay, to move past that and prove out the connection and the functionality I want, I'll move to one of my development environments where PHP 5 is up and running. I really should always start in the development environment, but how fun is that? The http://localhost/~joel/aor/SimpleStore.php?action=Search page looks the same, but now when I search results are returned! A book search for "Dale Carnegie, How to Win Friends and Influence People" returned 2 matches and a "Next Page" link: These books can be found at this link. So far the only steps I've needed to follow to talk to Amazon's mammoth database were: • sign up for an AWS account • download a sample • add my access key to a PHP 5 server Give it a try, and in the next blog we'll take this a bit further with an end goal of having it integrated within a real site. Questions so far? Post them in the Comments!
Categories
Contributors
- Allie Dennis
- Alec Francesconi
- Andrew Harper
- Al Lemieux
- Anthony Sorrentino
- Benjamin Greenspan
- Bob Quinn
- Brian Tetrault
- Brea Thomas
- Ben & Vince Schaefer
- Chris Alvanas
- Carlo Libertini
- Christopher O'Coin
- Corey Schreppel
- Christine Stavrou
- Dan Cardinal
- Dawn Deeks
- Daniel Goldfine
- Emily Clack
- Federico Muchnik
- Gene Babon
- Gregory Croteau
- Graeme Hall
- Gabe Herman
- Howard Kaplan
- Howard Phillips
- John Corbett
- Jono Forbes
- Joel McNamee
- James Murphy
- Jeanne Shapiro
- Kathryn Mora
- Kelly Perrault
- Ketsia Vedrine
- Lara Callahan
- Lucie Wicker
- Maureen Lawson
- Nicole Bedard
- Peter Eastwood
- Peter Kery
- Philip Percuoco
- Practicum Program
- Randall Armor
- Riordan Galluccio
- Ryan LaPerle
- Rich Volin
- Stephanie Bragg
- Scott Defusco
- Stacy Kadesch
- Special Guests
- Shawn Read
- Sarah Viera
- Tom O'Brien
- William Lee
- Zach Hannes
- Zack Holmes
Community Forums
- Portfolio Day 0 comment(s)
- Photography Showcase, May 30 0 comment(s)
- May 2012
- April 2012
- March 2012
- February 2012
- January 2012
- December 2011
- November 2011
- October 2011
- September 2011
- August 2011
- July 2011
- June 2011
- May 2011
- April 2011
- March 2011
- February 2011
- January 2011
- December 2010
- November 2010
- October 2010
- September 2010
- August 2010
- July 2010
- June 2010
- May 2010
- April 2010
- March 2010
- February 2010
- January 2010
- December 2009
- November 2009
- October 2009
- September 2009
- August 2009
- July 2009
- June 2009
- May 2009
- April 2009
- March 2009
- February 2009
- January 2009
- December 2008
- November 2008
- October 2008
- September 2008
- August 2008
- July 2008
- May 2008
- April 2008
- March 2008
- February 2008
- January 2008
- December 2007
- November 2007
- October 2007
- September 2007
- August 2007
- July 2007
- June 2007
- May 2007
- April 2007
- March 2007
- February 2007
- January 2007
- December 2006
- September 2006
- August 2006
- July 2006
- June 2006








