So Very Posh

Thanks for visiting! This is the weblog of Lynda, a 26 year old girl living in Atlanta with her husband, three cats and two cockatiels.


EE: Amazon API Plugin


PLEASE NOTE! I am no longer maintaining this plugin. Feel free to consider this Amazon API plugin free to use, change, distribute, etc. You don’t have to give credit, (it would be nice, but I don’t really care too much). I had no desire to create the plugin in the first place and did so only because I was used to MTAmazon when I switched from MT to EE. I feel bad about my inability to maintain it. I might pick up on my other plugins one day or at least update them, but I highly doubt I’m ever going to touch this again. API stuff burns a hole in my head and I’m not ready for it. smile

Now I just have a custom field for the ASIN/ISBN and simply link the image and create a link to the site. For my needs, I don’t really have a desire to pull in any other information, although I realize that will be helpful for others.

So again, take my plugin and do whatever you’d like with it.




I'm officially releasing the Amazon API plugin for Expression Engine. Currently, this plugin words with ASIN, KEYWORD and SIMILARITY searches.

In order to use this, you must apply for a developer's token. It's quick, easy and painless.

The file can be downloaded HERE.

Latest Version: 1.2 - 5/29/04.

Upgrade Instructions: If you're upgrading from a previous version, you will find a new file called config.php. This file will now contain your dev token and associate ID. Edit the file to include this information. Save and upload it to your amazon directory in the plugins folder. Replace AmazonSearch.php in your amazon directory and replace pi.amazon.php in your plugins directory.

Additional details on uploading and configuring the plugin can be found below. I HIGHLY recommend that you read the full documentation before using this plugin.

Sections:

Configuring the Plugin
Initiating the Plugin
Parameters
Required Variable Pair
Optional Variables
Conditional Variables
Example Usage
Revisions
REFERENCE: Product Mode Parameters


CONFIGURING THE PLUGIN


In order to use this plugin, you MUST have your own developer's token. You can optionally use your own Amazon associate's ID. To set this information, open config.php (found in the amazon folder) and look for the following:

// ---- SET THE BELOW VALUES --- //
$associate_id = "digitalwoe-20";
$dev_token = "";
// ---------------------------- //

Place your developer's token in the $dev_token variable. Make sure to keep the double quotes around it. You can optionally place your own associate's ID in the $associate_id variable.

Save config.php.

Upload pi.amazon.php to your plugins directory. Also upload the entire contents of the "amazon" folder (AmazonSearch.php, nusoap.php and config.php) to your plugins directory. You should have a folder called "amazon" with the contents of the amazon directory and pi.amazon.php in your plugins directory.




INITIATING THE PLUGIN


You can perform three different types of searches with this plugin. ASIN, Keyword and Similarity searches. Use the following tag pairs to initiate the plugin:

ASIN:

{exp:amazon:asin}

{/exp:amazon:asin}



KEYWORD:

{exp:amazon:keyword}

{/exp:amazon:keyword}



SIMILARITY:

{exp:amazon:similar}

{/exp:amazon:similar}




PARAMETERS


locale = "de"

You can localize this plugin to work with Amazon Germany, UK, US or Japan. By specifying local in the parameters, you can choose which version you'd like to use. Following are the codes for each localization:

de = Germany
uk = UK
jp = Japan
us = American

The default parameter is 'us' so you don't have to specify it if you are in the us.

Here's an example of use:

{exp:amazon:asin locale="de"}



category = "books"

This parameter can be used in KEYWORD and SIMILARITY searches to define the category for which results are returned. If omitted, the default is "books". This parameter has no effect in an ASIN search.

Example:
{exp:amazon:keyword category="dvd"}

IMPORTANT! Review the Product Mode Parameters section to find out what category to use!


limit = "5"

This parameter can be used in KEYWORD and SIMILARITY searches to limit the number of results returned. If omitted, the default is "5". This parameter has no effect in an ASIN search.

Example:
{exp:amazon:similar limit="5"}




REQUIRED VARIABLE PAIR


There is a variable pair REQUIRED for each type of search:


ASIN and SIMILARITY searches:

{define_asin} {/define_asin}

Place your ASIN within this variable pair.

Example:
{define_asin}0743418174{/define_asin}

If you are using the {exp:amazon:asin} or {exp:amazon:similar} tags WITHIN the {exp:weblog:entries} tags, you can use a field inside this tag. For example, if you have a custom field called {book_asin} you can use the variable pair in this manner:

{define_asin}{book_asin}{/define_asin}



KEYWORD searches:

{define_keywords} {/define_keywords}

Place your keywords within this variable pair. Keywords should be separated by a space or comma.

--------

It doesn't matter where you place this variable pair, but it MUST be defined inside the tags. If you are going to use a field, also be sure that it has formatting set to NONE in your publish preferences.





OPTIONAL VARIABLES


The following optional variables and conditional variables will work within each type of search:

{amz_asin}

This will return the Amazon ASIN back to you. This can be helpful if you're not using the plugin with weblog entries.


{amazon_link}

This will return a URL to the product plus your associate ID if entered.



{product_name}

This will return the product name.



{release_date}

The date the product was released.



{product_name}

The name of the product.



{catalog_type}

The section the product is displayed through on Amazon.



{manufacturer}

Manufacturer or publishing company of the product.



{retail_price}

This will return the retail price for the product.



{amazon_price}

This will return Amazon's price for the product.



{amz_authors}

This will return the authors of the product separated by a comma.



{img_small}
{img_medium}
{img_large}


Image URL for the small, medium and large images



{img_small_size}
{img_medium_size}
{img_large_size}


This returns the width and height of the small, medium or large image. It can be useful when setting displaying the image:

<img src="{img_small}" alt="{product_name}" {img_small_size} />

This will place: width="xx" height="xx" so your markup will validate.



{img_small_width}
{img_medium_width}
{img_large_width}


This will return just the width of the small, medium or large image.


{img_small_height}
{img_medium_height}
{img_large_height}


This will return just the height of the small, medium or large image.





CONDITIONAL VARIABLES


You can use the conditional variables described in the Conditional Variables section of the Weblog Variables page in the user guide for any of the above variables.

Here are some examples of use:

{if amazon_price}<b>Price:</b> {amazon_price}<br />{/if}


Another good use for this it so make sure there is an actual image before displaying image information. Amazon API will return an image URL regardless of whether there is an actual image for the product. (Therefore {if img_small} etc won't work)

You can check the width and height or just the width to determine if anything other than a 1x1 blank file is returned:

{if img_small_width > 5}<img src="{img_small}" {img_small_size} alt="{product_name}" />{/if}





EXAMPLE USAGE


Here is an example of using this plugin inside a weblog entries tag to display information. In this field, it is assumed the field containing the ASIN is {book_asin}:


{exp:weblog:entries weblog="weblog" limit="5"}

{exp:amazon:asin}
{define_asin}{book_asin}{/define_asin}

<b><a href="{amazon_link}">{product_name}</a></b><br />

{if img_small_width > 5}{if img_small_height > 5}
<a href="{amazon_link}"><img src="{img_small}" {img_small_size} alt="{title}" title="{title}" align="left"/></a>
{/if}{/if}

{if amz_authors}<b>Author:</b> {amz_authors}<br />{/if}
{if amazon_price}<b>Price:</b> {amazon_price}<br />{/if}
{if release_date}<b>Release Date:</b> {release_date}<br />{/if}

{/exp:amazon:asin}{/exp:weblog:entries}



REVISIONS


1.1 - May 27, 2004:
- Added localizaton preferences
- Stripped ASIN of any dashes for use with straight ISBN

1.2 - May 29, 2004:
- Added config.php file to hold dev_token and associate's ID.
- Added Keyword search
- Added Similarity search



REFERENCE: Product Mode Parameters


As indicated in the parameters section, you can define "category" to target the part of the site you want to restrict your search to. According to the API, here are the categories that should be used by locale:

Books
US: books
UK: books-uk
DE: books-de
JP: books-jp

Popular Music
US: music
UK: music
DE: pop-music-de
JP: music-jp

Classical Music
US: classical
UK: classical
DE: classical-de
JP: classical-jp

DVD
US: dvd
UK: dvd-uk
DE: dvd-de
JP: dvd-jp

Video
US: vhs
UK: vhs-uk
DE: vhs-de
JP: vhs-jp

Electronics
US: electronics
UK: electronics-uk
DE: ce-de
JP: electronics-jp

Kitchen & Housewares
US: kitchen
UK: kitchen-uk
DE: kitchen-de
JP: N/A

Software
US: software
UK: software-uk
DE: software-de
JP: software-jp

Computer & Video Games
US: videogames
UK: video-games-uk
DE: video-games-de
JP: videogames-jp

Magazines
US: magazines
UK: N/A
DE: magazines-de
JP: N/A

Toys & Games
US: toys
UK: toys-uk
DE: N/A
JP: N/A


The following are available for US only:
Camera & Photo: photo
Baby: baby
Outdoor Living: garden
Computers: pc-hardware
Tools & Hardware: tools

Comments

Comments are closed for this entry

What is an asin number? is it the same as the ISBN number?

Posted by The Linguist on 05/26 at 05:13 PM | Link

The ASIN is the same as an ISBN for books. Amazon calls all their product IDs ASINs.  The ASIN is available on the amazon product page.

Posted by Lynda on 05/26 at 05:15 PM | Link

ooh, yay. i will definitely be experimenting with this later smile

Posted by jade on 05/26 at 05:26 PM | Link

Very nice work! Thanks a lot!
(Now I only have to figure out how to use it with Amazon Germany - AmazonSearch is querying Amazon US only, so no results are found for most german books.)
-ms

Posted by Markus on 05/26 at 05:38 PM | Link

Markus, to use it with Amazon Germany, try this.

Open AmazonSearch.php and find this line:

define(’WSDL_FILE’, ‘http://soap.amazon.com/schemas2/AmazonWebServices.wsdl’);

change the URL in there to this:
http://soap-eu.amazon.com/schemas3/AmazonWebServices.wsdl

Then in pi.amazon.php find this line:

$amazon_link = “http://www.amazon.com/exec/obidos/ASIN/” . $amz_asin . “/” . $associate_id . “/ref=nosim/”;

And try changing the .com to .de

I have *absolutely* no clue if that will work, but it’s a start.

Posted by Lynda on 05/26 at 06:03 PM | Link

I got it running on my book review blog
http://books.blinger.org

Just a note when adding ISBN numbers do not put the dashes, it will break the page

0-13-041392-5 is bad
0130413925 is good

Posted by The Linguist on 05/26 at 06:33 PM | Link

Thanks, Lynda.

Good starting advice. Checked that already but it seems I have to hack AmazonSearch.php even more. From the API docs:

“Amazon Web Services uses the US Web site as the default site for shopping and fulfillment.  To target a request for a specific country, you need to both append a parameter to the call to identify the country in question, and (for UK and DE), use a slightly different URL in making your calls...”

and

“Users of international AWS should be aware that product mode parameters vary slightly on a country-by-country basis, and that a service call will not work if an incorrect mode is used...”

I’ll try to figure out the details as soon as possible and keep you informed.

Best regards
Markus

Posted by Markus on 05/26 at 06:48 PM | Link

Keep in mind you’re using Amazon’s ASIN, not the ISBN.  Yes, they are the same number, but Amazon’s ASIN does not have dashes and is just a number.

I’ll see about adding functionality to strip dashes if that would be easier.  It’s not difficult to add.

Posted by Lynda on 05/26 at 07:23 PM | Link

oooh, i’m going to try this tomorrow.  : )

Posted by julie on 05/26 at 08:31 PM | Link

How would I make a booklist uisng this?

Should I create another ‘book blog’, much in the similiar way that LisaJill has showed us how to do with her BlogRoll tutorial?

Or should I wait until someone writes an acompanying (sp?) plugin for a bookqueue?

Posted by Jake Covert on 05/26 at 09:03 PM | Link

I’m not sure what a “bookqueue” is.  Could you define that for me?

It depends on how you want to use this.  You can assign the ASIN directly in the code, so you don’t technically need to use this inside the weblog:entries tag and you can also use it more than once, so you could do:

{exp:amazon:asin}
{define_asin}ASIN1{/define_asin}
other desired code here
{/exp:amazon:asin}

{exp:amazon:asin}
{define_asin}ASIN2{/define_asin}
other desired code here
{/exp:amazon:asin}

Posted by Lynda on 05/26 at 09:11 PM | Link

You’ve done some seriously nice work!

I’m gonna put this in somewhere. : )

Thanks Lynda!

Posted by yoshi on 05/27 at 01:06 AM | Link

Just so you know… I was at working using IE and your site is broken. I know it looks fine in firefox, but not IE

Posted by The Linguist on 05/27 at 03:02 AM | Link

The mt bookqueue plugin that I grew to love so much was a little app that integrated with the Amazon API.

It keep a running list of the books one had read, was reading, and was planning to read.

Using it’s own calls, you could decide to show, say 10 of the latest books.

Posted by Jake Covert on 05/27 at 05:46 AM | Link

The latest revision 1.1 is out.  Localization preferences were added per Markus’s request and help.  Per The Linguist’s recommendation, dashes are now stripped from the ASIN so you can copy straight from an ISBN if you need to.

I’d suggest subscribing to comments if you’d like to be notified of future updates.

Posted by Lynda on 05/27 at 08:23 AM | Link
Trackback:
Amazon plugin for ExpEng...
Tracked on: Mama Write's Sideblog on 05/27 at 06:23 PM

thankyou for the update, lynda! i much prefer to use amazon UK for it because the book covers are generally the same as they are here but the US ones are often different.

Posted by jade on 05/27 at 08:49 PM | Link
Trackback: More boring EE stuff
I installed Lynda's Amazon API Plugin last night. Now this page is rendering in about 5 seconds, and not the less that one second that I previously boasted about. No one else seems to be having this problem. I'm sure I did something wrong. If not, I might consider taking it down and using the MTAmazon, I was previously using. Oh, if you're interested, I finally got around to changing the download. Ciao!
Tracked on: Tummy Monsters on 05/28 at 10:31 AM

This plugin has been updated to version 1.2 to include keyword and similarity searches.  In addition, the associate id and dev token are now called from an external config.php file.

Posted by Lynda on 05/29 at 10:54 AM | Link

Lynda - A few comments up, I noticed you told Markus to change a line to get it working with Germany - would the same hold true if I wanted it to work with amazon.ca?

Posted by Babs on 05/30 at 02:00 PM | Link

I forgot about canada.  I’ll make an option for Canadian localizations as well.  It probably won’t be until tomorrow though.  In the meantime, you can try exchanging the amazon.coms for amazon.cas in the pi.amazon.php and see if that works.  I’m not sure, but I think the WSDL (or is it WDSL? can’t ever remember) file points to the same location for both us and ca.

Posted by Lynda on 05/30 at 03:19 PM | Link

First of all, thanks so much for making this awesome plugin available for everyone! It rocks!!

I am implementing it on one of my sites right now, but I think I have discovered an issue with the category and locale parameters. This works fine:
{exp:amazon:keyword category="dvd" limit="3"}

The below works too, except that it only shows books, it seems to be completely ignoring the category parameter:
{exp:amazon:keyword category="dvd" limit="3" locale="uk"}

I have tried switching the parameters around, but I haven’t gotten it to work yet. I have tested this with “de” and “jp” as well, and with “de”, the same thing happens, it only shows books. The “jp” one however, does work properly and shows DVDs.

I suspect that this is a small bug, so I just thought I’d let you know. smile Thanks again for all your hard work!

Posted by Sasha on 06/01 at 09:26 AM | Link

Thanks for letting me know about this.  I remember something being set to default for de and uk (it uses a different file to tap into the api) but I thought I removed it.

Posted by Lynda on 06/01 at 09:35 AM | Link

Babs, I’m not sure that Canada is supported with Amazon Web Services.  Their site states: “Both of these methods return structured data (product name, manufacturer, price, etc.) about top-selling products at Amazon.com (US), Amazon.co.uk (United Kingdom), Amazon.de (Germany), or Amazon.co.jp (Japan) based on parameters such as keyword search terms and browse nodes.”

Could you tell me if changing the amazon.coms to amazon.cas work the way you would expect it to?  If so, I can make it another preference.

Posted by Lynda on 06/01 at 09:41 AM | Link

Hi Sasha, I found the problem was that I didn’t give instructions for which category to use.  Please see the newly added reference section above for the correct text to place in the category parameter.

Posted by Lynda on 06/01 at 11:15 AM | Link

Thanks Lynda, it’s working perfectly for the UK locale now! (if you want to see it in action, surf to fever-of-fate.com and look in the wallpaper and scan sections) :D

Posted by Sasha on 06/01 at 11:35 AM | Link

A big “thank you” from me as well, especially the added the keyword and similarity search capabilities rock grin The reference section is extremly useful, too!

Posted by Markus on 06/01 at 12:35 PM | Link

Can some of you that have implemented this, give examples of the code you used, your setup, and possibly an example website?

Thanks everyone.

grin

Posted by Jake Covert on 06/01 at 06:16 PM | Link

Here’s the coding I’m using.

This code is placed at the total bottom of the template that I’m using to show only single entries. To see it in action, look here, or here, for example. Hope that helps you! smile

{exp:weblog:entries weblog="scans" limit="1"}<h3 class="shoph3">More {title} ...</h3>
<div class="shop">
<table border="0"><tr>
{exp:amazon:keyword locale="uk" category="dvd-uk" limit="4"}
{define_keywords}{title}{/define_keywords}
<td class="centersmall" width="25%" valign="top">
{if img_small_width > 5 }<img src="{img_small}" alt="{product_name}" {img_small_size} border="0" />{/if}<br />
<a href="{amazon_link}" target="_blank">{exp:word_limit total="8"}{product_name}{/exp:word_limit}</a>
</td>

{/exp:amazon:keyword}
</tr></table></div>{/exp:weblog:entries}

Posted by Sasha on 06/02 at 05:08 AM | Link

So it looks like you set up a separate blog for the book entries.

Did you then define a custom field group / custom field for the ISBN (ASIN)?

...thus making every ‘post’ to the book blog a book/cd/dvd entry?

Posted by Jake Covert on 06/02 at 05:43 PM | Link

Jake,

That’s exactly what I did here, though there are only two reviews so far and I haven’t updated to the newest version of the plug-in yet.

Posted by The Linguist on 06/02 at 07:36 PM | Link

Thank you so much for this.  It was easy to install and implement.

Posted by kdeweb on 06/02 at 07:51 PM | Link

Lynda, I changed the .com to .ca in pi.amazon.php and everything still works. Would you recommend changing it in the other files as well? Basically what I’d like to do is pull the canadian price of the items vs. the american prices. :crossfingers:

Posted by Babs on 06/05 at 02:59 PM | Link

Hey Babs.  Amazon hasn’t released an API for Canada yet, so there’s no way to pull in Canadian prices yet.  They say Canada and France are coming soon.

Posted by Lynda on 06/05 at 05:21 PM | Link

I keep having issues. well. with the plugin. not me personally. anyway. If I add and ASIN number for a CD that doesn’t have cover art, My blog returns {if img_small_width > 5}{/if}

I was having the same problem is I posted an entry that did not contain an ASIN - would just show me the container tags. I fixed the ASIN issue with an if statement - if asin is empty show this if has content show something else.

But I’m not sure how to build the same kind of fix for images.

http://www.babineau.ca/media

Posted by Babs on 06/06 at 08:13 PM | Link

Hey Babs.  I think I know what the problem is and will look into this as soon as I can.

Posted by Lynda on 06/07 at 07:10 AM | Link

Hey Babs, the problem wasn’t what I thought it was.

I tested this on a couple of ASINs that had no cover art and it actually worked the way it was supposed to..  The only way I would think it wouldn’t work is if NO image is returned.... (amazon is supposed to return an image regardless)

Could you try plugging an: {if image_small) {/if} around the whole thing and see if that works?  Could you give me a couple of examples of ASINs this is happening to in order to test it to see if it’s something I can replicate?

Posted by Lynda on 06/08 at 05:30 PM | Link

Also, for your ASIN problem, do you mean if the ASIN wasn’t assigned you’d get the define_asin container tags, or you’d get them all?  If it’s the former, I think that’s something I can fix on my end.

Posted by Lynda on 06/08 at 05:32 PM | Link

I just realized that I had changed all the .coms to .cas I’m going to put them back to .com and see if that’ll fix it before trying anything else.

Posted by Babs on 06/08 at 07:07 PM | Link

Example ASIN that I’m having a problem with: B00006L5LT, B000024M7J.
I’ve put it back on my site so that you can see the result. It also makes the {if img_small_width > 5}{/if} code appear on a completly unrelated entry.

I’m not sure what you mean by “plugging an: {if image_small) {/if} around the whole thing” I’ve got his as my code now which seems to be what you’re asking me to do.

{if img_small_width > 5}{if img_small_height > 5}
{title}
{/if}{/if}

As far as the ASIN issue - if I do not assign an ASIN - I get the Define asin container tags. I’ve fixed this on my side by only including the tags if that field is not empty

{if media_asin != “"}
{define_asin}{media_asin}{/define_asin}
{/if}

Posted by Babs on 06/08 at 07:41 PM | Link

Thanks. now I’m getting {if img_small}{/if} (still on both unrelated entries)

Posted by Babs on 06/08 at 08:00 PM | Link

Hey Babs.  It looks like the problem is those products are only available in Canada, not the US.  According to the Amazon API documentation, an API doesn’t currently exist for Canada.  I’ll do some more research to see if there’s anything out there for Canada yet.

The only .com that needs to be changed to .ca is in the pi.amazon.php file.  You might be getting strange results if you changed the WSDL in the AmazonSearch.php file .ca.

It should actually be returning NOTHING at all for these ASINs (that’s what it does for me)

Unfortunately, there’s no way I can make it work for Canada until Amazon releases an API for Amazon Canada.

Posted by Lynda on 06/09 at 09:05 AM | Link

that’s awesome thanks for confirming that.

any reason however that {if img_small_width > 5}{/if} also shows up in the unrelated entry when a canadian only ASIN is put in an entry?

media page is currently showing this behaviour.

Posted by Babs on 06/15 at 10:17 PM | Link

I have absolutely no idea why it’s doing that for Canada and not US.  It’s probably returning some weird things if you’re trying to use an API that isn’t fully developed.

Posted by Lynda on 06/16 at 07:26 AM | Link

Got this work perfectly.  Thanks for all your hard work.

One question though:

Is there any way you could set the plugin to cache it’s database calls?  What if the amazon server is down or not responding?  I know you could cache the page from a php / EE perspective, but I think having the amazon db calls cached would be really cool as well.

Cheers,

Jake

Posted by Jake Covert on 06/16 at 10:29 PM | Link

I’m sure there’s some way to do this, but I don’t know too much about caching.  The image wouldn’t be able to be pulled to your server though.  If the amazon server is down, the information simply won’t show up on your site.

As for Bab’s problem - you’re using Canadian ASINs.  At least that was the case with the couple ASINs you sent me the other day.  If you try to plug the canadian ASIN into the US version, you get nothing at all.  They probably have some weird stuff in their api for the ASIN which is why you’re getting weird results.  I would suggest finding the ASIN on the US site and using that one instead of finding the ASIN on the Canadian site.

Posted by Lynda on 06/17 at 07:15 AM | Link

Do you know what the tag would be to get the amazon book description?

Posted by Jake Covert on 06/17 at 10:05 AM | Link

I’m not sure Amazon sends the book description through the API - they do send reviews, but I didn’t bother with that.  I’ll look into it when I get a chance, but I don’t think they provide it.

Posted by Lynda on 06/17 at 10:07 AM | Link

Ok.  Thanks for your help.

For others out there, as another example of this set up, you can visit my booklist here:

The Covert Booklist

Lynda, out of curiosity, how did you get the ratings images?  Just pre-defining the ratings categories, and then assigning star images to each of them?

Posted by Jake Covert on 06/17 at 10:17 AM | Link

Awesome plugin Lynda.  I wish I understood PHP enough to write plugins like this. 

One request/wish:

I also would love to see it cache the database calls.  Maybe Paul or Rick would be able to help with this?

Thanks again I’m loving the plugin.

Posted by Methnen on 06/18 at 05:37 PM | Link

I will definitely look into caching, but I’m not sure when I’ll get around to it.  It shouldn’t be too difficult to cache the info returned from the API, but I know nothing about caching.  I should be able to figure it out by looking into how it’s currently done in EE.  Still, I just don’t know when I’ll get a chance to fiddle with it.  But I WILL be fiddling with it at some point.  smile

Posted by Lynda on 06/18 at 05:46 PM | Link

Glad to hear it.  I look forward to you finding the time.  smile I know how that works.

Posted by Methnen on 06/18 at 05:50 PM | Link

Terrific - thanks for this. Now I must try to come up with something useful myself for the EE community.

Posted by Adam Khan on 06/30 at 07:13 PM | Link

Hi,
Implemented your plugin.  All seems to be working well but when I click on any of the monthly archives I get this
{if amazon_price}Price:
{/if} {if release_date}Release Date:
{/if}
on the left side of the entry.
It only happens of the monthly archive links...not on the index page, category pages or the pagination entry archives.
Do you have any ideas?
Thank you,
Martie

Posted by Martie on 07/04 at 12:18 PM | Link

my weblog is at www.martiegras.com/blog/

Also here is an example of one of the monthly archives page.

Posted by Martie on 07/04 at 12:22 PM | Link

I have no idea why it’s doing that.  :( You’re not trying to use Canadian references, are you?

Posted by Lynda on 07/04 at 09:37 PM | Link

Oh, I see what’s going on.  I’m still not sure what might be causing it.  Hmmm.  Are you using any other sorts of PHP or plugins on your archives, category pages/etc?  If you turn on debugging to display for everyone, do you get any errors?

Posted by Lynda on 07/04 at 09:40 PM | Link

As far as the archives and category pages I am not using any PHP or plugins.  In my index page I am using PHP for
Private entries, random quotes, and for copyright.  For plugins I am only using this amazon one. 
I turned on debugging and as far as I can tell it gave me no errors.  I don’t know......

Posted by Martie on 07/06 at 06:25 PM | Link

Lynda, Every so often I get this error message (instead of my journal loading)

Warning: Invalid argument supplied for foreach() in /home/babineau/public_html/journal/sys/plugins/amazon/nusoap.php on line 5489

Fatal error: Call to undefined function: asinsearchrequest() in /home/babineau/public_html/journal/sys/plugins/amazon/AmazonSearch.php on line 108

It’s always the same lines and the same errors. Do you know what this might be?

Posted by Babs on 07/06 at 07:13 PM | Link

Sorry, I probably also have mentioned that if I refresh, my page will load correctly.

Posted by Babs on 07/06 at 07:18 PM | Link

Hello,

my englisch ist not very good, but i will try.

I downloaded your class, but i don’t know how to get it to work.

This is the first time i will work with classes.

Please give a litte example, how i include the class in a php file.

Thank you very much.

Nico Sprenger

Posted by Nico Sprenger on 07/12 at 09:15 AM | Link

Just found out, that for german users, there is category “books-de-intl-us” for finding international books in english to.

Is there any possibility to configure multiple categorys, because if i don’t select any category i have no result in intl-us books.

Posted by leu on 07/12 at 09:50 AM | Link

I just was reading a little bit about possibilities and i think it would be great to have a blended search option. wink

Posted by leu on 07/12 at 10:41 AM | Link

Hi Lynda
Amazon Plugin is great. But, as you perhaps allready have seen in pmachine forum, it extremely slows down the site. Page render times going up from 0.3 seconds to up to 8 seconds. i can see on your site that it is similar to mine from speed and even sometimes i had blank pages.

do you think about adding some caching preferences for the amazon api?

regards

Christian

Posted by leu on 07/19 at 07:23 AM | Link

I’d love to be able to cache, but unfortunately I am not familiar enough with the caching process to do it for the amazon plugin.  I’ve tried, but I just end up lost.

I have a lot going on in my pages which results in high load times.  The amazon information from the plugin really doesn’t increase the load time for my site by more than a fraction of a second.

Posted by Lynda on 07/19 at 11:45 AM | Link

i think you’re just closer to amazon than i. wink

ok, i will try it again!

Posted by leu on 07/20 at 04:27 AM | Link

Do you need help finding / engaging some people that might be able to assist in the cache’ing problem?

Posted by Jake Covert on 07/22 at 05:45 AM | Link

Well, I figured out the blank pages are caused by nusoap.php, but I haven’t been able to find a solution for it.  WordPress’ Amazon plugin experiences a similar thing.  I’m going to investigate alternate methods to access Amazon’s API and will try to rebuild the plugin completely - hopefully including some sort of caching option.  No idea how soon that will be though.

Posted by Lynda on 07/23 at 12:41 PM | Link

Hey, first of all, i could get better performance with tag caching from expression engine. Try it. Also i included a blended functionality, are you interessted in this? perhaps you could include it in a other version. it’s not perfect, but it finds the book i want to display from de-books-int. wink

Posted by leu on 07/26 at 12:39 PM | Link

I’ve recently upgraded to PHP5 and it breaks this pluggin.  Have you had a chance to take a look at this?

Posted by Halogen on 08/15 at 03:21 PM | Link

Nope.  I have no desire to install PHP on my home machine and my server hasn’t upgraded yet (and I hope doesn’t soon because there’s nothing worse than upgrading to a new version of PHP as soon as it comes out) For now, I guess it just doesn’t work in php 5.

Posted by Lynda on 08/16 at 01:31 PM | Link

I’m surprised you don’t have a development environment.

Can you at least put in a notice, lettting people know that the current version is not PHP5.0 compatible?

Posted by Jake on 08/23 at 10:39 AM | Link

I’ll edit this entry eventually.  Until then, there’s notice right here in the comments.

Posted by Lynda on 08/23 at 11:08 AM | Link

Lynda,

I tried using the author tag {amz_authors} but that doesn’t seem to work with CD’s or music. 

Is there any way to add a tag for Artist?  (for music/CD’s)

Posted by Mark_Malewski on 09/09 at 06:22 AM | Link

and maybe even a tag for album?  {amz_album}

Posted by Mark_Malewski on 09/09 at 06:23 AM | Link

I agree - would be super-rad to have music-specific tags.  It would also be really cool if it were possible to syndicate lists automatically using the affiliate tags - specifically wish lists…

Thanks so much for the plugin - it’s awesome!!

Matthew

Posted by Matthew on 10/16 at 02:43 PM | Link

Lynda...
----------
Just getting into this and have a couple of questions grin
1) Am testing with products from the “Home Improvement” category, is pulling down the retail price but not the Amazon price even though both are shown at Amazon. Are some of these tags only good for certain categories?
2) Is the plugin only good for the tags you list “amazon_price”, etc. or can a person get other data like how many are in stock and expected delivery?
----------
Have a manufacturing client that sells a lot of various items to Amazon. Amazon is overwhelmed and not real great at watching their inventory levels so his #1 job each morning is to visit all his product pages and fire off email reminders when stock is low. Thought I could make his life a lot easier if he just hit a report page using your plugin. Plus trying to save myself some work right now even though I’m going to have to get into the Amazon Web Services soon.

Any info/direction would be greatly appreciated...Love the plugin!!!

Posted by PXLated on 10/16 at 03:35 PM | Link

Update...
1) I’m now getting the Amazon Price after reading the Amazon Web Services info. Of course, I read all the v4 docs before I realized the plugin uses the v3 APIs/SDK :-(
2) The plugin pulls down data in “lite” mode. Changing it to “heavy” brings down a lot more data including the stuff I needed. Had to create some additional tags in “pi.amazon.php” file. I now have “prod_availability”, sales_rank, etc. Need to get customer reviews yet but that comes down as an array as far as I can tell. Not being a programmer, I’ll have to get a php-type to figure that out. I know just enough to be dangerous grin

Posted by PXLated on 10/16 at 11:59 PM | Link

I couldn’ get a ‘developer’s token’, hey gave me a ‘subscription ID’ instead.

Is that the same, or do I need to do something different.  I can’t get it to work.

Posted by Jon on 11/13 at 12:26 AM | Link

Jon...
I’m pretty sure it is. Somewhere on the Amazon developer site they mention that they changed the name of it...as I recall anyway grin

Posted by PXLated on 11/13 at 10:14 AM | Link

On Second Thought...
Uhhhh...they used to be called “tokens: and they changed it to developer “id” so I’m not 100% sure the “subscription” is the same as “developer”. Been awhile since I poked around the Amazon site.
But as I recall, they first sent me a temporary id (subscription?) and then awhile later sent another email verifying that I was accepted and that temporary id became my developer id.

Posted by PXLated on 11/13 at 10:20 AM | Link

Anyone else notice that the {amazon_price} variable doesn’t appear to be working at the moment?

Posted by Les on 11/20 at 05:18 PM | Link

Same problem here: {amazon_price} is empty. Help!

Posted by tschulz on 11/29 at 07:03 PM | Link

Price missing...I’ve found that happens off and on. Also, at times Amazon is sooo slow. This pluging use their old APIs, wonder if their new ones are more reliable and faster.

Posted by PXLated on 11/30 at 11:26 AM | Link

Unfortunately I’ve had absolutely no time to fiddle with this plugin.  I’d like to get back to it some day, but for now, consider it “as-is”

There are a couple more EE Amazon plugins out there right now which might be more updated than this one.  I’ve seen them, but I’m not sure off the top of my head who did them or where they can be located.

Posted by Lynda on 11/30 at 11:30 AM | Link

New plugins...I know of one that uses the new APIs but it also requires PHP5 which most hosts I use (including pMhosting) won’t install till early spring.

Posted by PXLated on 11/30 at 01:27 PM | Link

Where/what is the plugins directory?

Posted by Confused on 12/21 at 04:56 AM | Link

There’s a website specifically set up for cataloging plugins for EE. You’ll find it at: http://plugins.pmachine.com/.

Posted by Les on 12/21 at 01:59 PM | Link

Hi,

Not sure if this forum is still live but I am in desperate need for some help just to get it working. Is there special software or something that I need to install on my server? All I’m getting are parse errors.

Could you provide an example on how to build a page. I must be doing something really bad as every-one else seemed to have got it working no problem. :(

I hope some-one can help

Mark

Posted by Mark Smith on 03/11 at 10:37 AM | Link

Mark...
I’m presuming you are using EE. You need to download the Amazon Plugin (link a couple posts up), install that in the EE system plugins folder on your server, set up your page for the plugin tags, and that’s about it.  You can find a couple example links here...Scroll down toward the end, look for Amazon. There’s the plugin method as well as one using RSS and the REST method.
Hope that helps.

Posted by PXLated on 03/14 at 11:15 AM | Link

Hi,

Call me stupid!! I’ll let you smile

I came to this page through google so knew nothing about EE before I last posted here. It’s abit to expensive for me, so the search continues…

Mark

Posted by Mark Smith on 03/14 at 01:35 PM | Link

I really like the Amazon plug-in but I wonder if anyone can help with this problem:

I want to search for an author say Joe Bloggs but I might get books by the joint authors ‘Joe Smith’ and ‘Daisy Bloggs’, because the plugin is configured to separate out the two words separated by spaces. What I need is to ONLY get books by the author Joe Bloggs. I have tried separating the words by and all sorts but I cannot see where this is happening. Any hacks / advice really appreciated!

Posted by Chris Jennings on 03/15 at 09:43 AM | Link

Mark...
You might want to look at pMachinePro if EE is too much. It’s free and I think there is an Amazon plugin for that also...it would be different than this one I believe.
Also, in my link above, the REST method *AmazonRSS) does everything through the URL and returns XML. I’m using another EE plugin to parse that XML but there are plenty of tutorials on the net (search Google) for how to do it.

Posted by PXLated on 03/15 at 12:04 PM | Link

Chris...
It’s been a long time since I monkeyed around with this so I really can’t remember all the things I tried but, the plugin tag for author is “amz_authors”. I would think you’d be able to do an “if” statement to just select/display a certain author as it parses through the list.

Posted by PXLated on 03/15 at 12:10 PM | Link

Thanks PXLated. I tried that but can’t get is to work.Maybe I can’t use this in a conditional/if statement.

Posted by Chris Jennings on 03/15 at 05:50 PM | Link

You can’t use an if statement because that’s something that needs to be passed through the plugin, therefore programmed into the plugin and the only two conditionals I programmed are above.

You might be able to use PHP, but I’m not sure of that either because of when the information is pulled from amazon and parsed through EE.

Posted by Lynda on 03/15 at 05:54 PM | Link

Like I mentioned, been a long time since I set mine up, and it’s not something I need or use, was simply an experiment. So you need the experts to figure this out grin

Posted by PXLated on 03/15 at 10:46 PM | Link

I am concluding that the ONLY way to be sure to get an author’s book out is to use the ISBN/ASIN, so I need to put a list of those in a custom-field and then loop through. The keyword search seems to do this but not ASIn search, which is set up to just search for one.

Thanks for your thoughts!

Posted by Chris Jennings on 03/16 at 04:04 PM | Link

In my plugin (Soap) example...links above...I have one EE entry per record (book/product) with the ISBN/ASIN and it loops through all open records and displays them. If I don’t want to show a particular book/product, I just close the EE entry.

Posted by PXLated on 03/16 at 04:25 PM | Link
Trackback: If you're switching...
And you've gone with EE, you're probably goind to come across Lynda, sooner or later. Most likely sooner. I've converted my booklog to EE, and I've used Lynda's EE: Amazon API Plugin. It's very cool! My bookblog is at the...
Tracked on: music to my eyes on 06/05 at 02:08 AM