tags:

views:

227

answers:

3

Happy new year every one.

I have integrated Amazon Product Search using the widgets they provide within my website. I also want to integrate it within my cocoa app.

Any idea how this can be done? Do they have an API/web service which we can use in the cocoa app?

Thanks..

A: 

You can create an HTML frame for the gadget and embed it in the Cocoa app using UIWebView on the iPhone, or using WebView on the desktop side.

Assuming that you stored the HTML required for presenting the gadget in htmlSnippet, and have already setup a WebView, you can simply load it via:

[[webView mainFrame] loadHTMLString:htmlSnippet baseURL:someURL];

(Where someURL is used to resolve relative URLs in the HTML source.)

notnoop
+3  A: 

Do they have an API/web service which we can use in the cocoa app?

Yes. Delicious Library uses it. I think this is the one, although I could be wrong.

Note that you can't use this if your Cocoa app shares the data with a Cocoa Touch counterpart. Delicious Monster had to discontinue their Library iPhone app after Amazon changed their terms of service to forbid API users (e.g., Delicious Monster, you) from sending data obtained through the API to an iPhone.

Peter Hosey
Thanks for the pointer to the post about the licensing issue: saved me a lot of wasted effort. +1
jkp
A: 

There are a few wrappers over this Amazon API for Python and Ruby, which you could integrate into you app using PyObjC or MacRuby. This may be a faster way to implement this instead of having to roll your own Objective-C layer over these web service calls.

RyanWilcox