Center for Digital Imaging Arts, Boston UniversityWaltham MA CampussplitWaltham MA Campus
Blog - Center for Digital Imaging Arts at Boston University
    Come connect with Boston University CDIA on Facebook so you can find out more about our certificate program in Audio engineering Boston University Certificate in Web Development can be found on LinkedIn Get updates surrounding our 3D animation program and certificate on twitter See the fantastic video work that our digital filmmaking certificate students create in film school at Boston University Center for Digtial Imaging Arts digital filmmaking certificate at Boston University Center for Digital Imaging Arts
CDIA Blog

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!


Link|

Comments are closed.

Top Posts
Links Tag Archive