UPDATE: Since originally posting, the site’s been getting a lot more traffic than usual so I’ve made some improvements to Zuggest.
I incorporated some zuggestions (groan) which folks emailed so the overall UI is a little nicer. I’m definitely HTML impaired. I’ve also improved caching on my server so Amazon doesn’t get such a big whack. Still tweaking things but have definitely learned a lot over the last few days.
I’ve also upgraded to the latest Amazon web service WSDL. Tonnes more information available such as list, new and used prices, even inventory levels on used items! Great stuff.
You’ve got to make life interesting and I just couldn’t resist! After hearing all the buzz about XMLHttp (eh, it’s been out for 2 years already) I figured I’d take a look at it. This is my take on “Google Suggest” only with Amazon so I’ve called it “Amazon Zuggest” – TAKE A LOOK AT IT HERE.
This is a technology experiment in creation of Rich Internet User Interfaces using asynchronous communication from a browser to the server to gather data while the user’s doing something else.
While you type, the page gets results without a page refresh and without having to hit “submit” all the time.
The webserver constructs a SOAP request and sends it to the Amazon Web Services server (AWS ECM 4.0). Amazon sends back a SOAP response to my server, this response is then parsed into HTML. I think this is where Zuggest differs from Google Maps.
I think Maps is sending back XML to the browser and that gets XSLT’d into HTML on the browser. I do that part on the web server and stream HTML to the browser.
Lastly, I cache all the results on my side and check the cache before I query anything. I also cache the results on the browser side, so if you’ve searched for something you can just mouseover the history to bring it straight back, instantly. All in the blink of an eye.
You can’t issue XMLHttp requests from the browser back to a domain other than the one the original page was served from. Otherwise this would be REALLY fast, as in Google Suggest. Google Maps works the same way.
I’ve tested it in Firefox and IE6 without too many problems. Again, this is an experiment so it’s a little rough around the edges. It would be a little nicer if I wasn’t restricted to 1 request every second max to Amazon.
Question from Jonathan Sambrook:
Does the Amazon API allow you to use amazon.co.uk ? Answer: Yes. There are WSDLs available for the US, UK, DE, JP, FR and CA Locales although Zuggest only searches the US right now.
Question from Roshawn Dawson: You said that you are using Soap. Are you using a code-behind file? Answer: Yes. The XMLHttpRequest is sent to my ASP.NET page from the browser. The code-behind constructs the SOAP message, etc. etc.
What do you think? Would love to hear your thoughts or happy to link to other experiments like this.