WebGUI
      Click here to register.
      
irc://irc.freenode.net#webgui

iPhoneGuy: WebGUI is a pile of crap.
rizen: If WebGUI is such a pile of crap, why do you use it?
iPhoneGuy: Because it's the best pile of crap out there.

If this is what people who hate us are saying, imagine what people who love us will say. Come join us on IRC.

AWS E-commerce System Macro

User: knowmad
Date: 7/1/2007 12:07 am
Views: 2122
Rating: 5    Rate [
|
]

NAME

WebGUI::Macro::AWS_ItemLookup

DESCRIPTION

The AWS_ItemLookup macro uses Amazon E-Commerce Service to lookup book, music or other item details from the Amazon website using an ASIN (Amazon Standard Item Number). For books, the ASIN is the same as the ISBN.

USAGE

   ^AWS_ItemLookup(ASIN,YOURACCESSKEY);

SEE IT IN ACTION

Screenshot

INSTALLATION

To use this macro, you will need to install XML::Parser and XML::XPath. XML::Parser is a compiled module. To install it under Linux, follow the steps below:

  • become root user
  • source setenvironment (. /data/wre/sbin/setenvironment)
  • run cpan (perl -MCPAN -e shell)
  • install XML::Parser
  • if you run into errors, be sure that you have installed the libexpat1 libraries (for Ubuntu you need to install the build-essential and libexpat1-dev packages to build)
  • install XML::XPath

Now you're ready to install the macro. See the POD in the AWS_ItemLookup.pm file for details about installing macros into WebGUI.

Before you can access the Amazon Web Services, you'll need a developer's key. You can obtain one here for free. There are some services which require a fee to use. The ECS service which this macro uses is free. 

TEMPLATES

Currently the output format is fixed. A future task will be to allow the output to be templatable. Patches are welcome.

AUTHOR

Copyright 2007 by William McKee. All rights reserved.

LICENCE



This program is free software; you can redistribute
it and/or modify it under the same terms as Perl itself.



Replies

Re: AWS E-commerce System Macro
User: fishingfan
Date: 7/24/2007 8:27 am
Rating: 0    Rate [
|
]
Status: Approved

Normally the users of an AWS application should only need an affiliate Id, not a developer Id. 

Chris

CA-Dev.co.uk 


Re: AWS E-commerce System Macro
User: knowmad
Date: 7/24/2007 8:39 am
Rating: 7    Rate [
|
]
Status: Approved

Chris,

Thanks for the feedback. I was simply following the examples provided by the AWS documentation. It's on my TODO list to get an affiliate id and try this macro with it. My guess is that it would work without a change. Have you tried it?

William 


Re: AWS E-commerce System Macro
User: fishingfan
Date: 7/25/2007 8:10 am
Rating: 1    Rate [
|
]
Status: Approved

Hi William

No but I am planning to Laughing, once I finish my upgrading of sites to 7.x, shortly. 

Saw it as was looking on this site.  As I recall you need to use the developerId to get the request, but this is the same for all users of your code against AWS (so anybody using the macro should use your developerId, but use there own affiliateId to identify their website for sale commissions).

By the way have you had any issues with "funny" characters being sent in the AWS feed using the perl XML parsers ? I see this sometimes with the Asset I wrote.   

Chris

CA-Dev.co.uk 


Re: AWS E-commerce System Macro
User: knowmad
Date: 7/25/2007 10:29 pm
Rating: 8    Rate [
|
]
Status: Approved

Chris,

Are you suggesting that I should be publishing my developerId with this macro? No way. That id can be used for paid services. Based on my rereading of the docs and forum posts, I think that the affiliate id would be used when you generate the links, not for accessing AWS ECS. Currently this macro is just grabbing info off the server, not creating links. There are lots of possibilities.

I haven't used XML::Parser much but have not seen this problem. I may rewrite the macro to use regex parsing instead of requiring XML::Parser to be loaded. Perhaps WebGUI already has some type of XML parser installed with the WRE.


William 


Re: AWS E-commerce System Macro
User: fishingfan
Date: 7/26/2007 5:56 am
Rating: -3    Rate [
|
]
Status: Approved

Hi William

After reading the docs on the site, I realise I am out of date. Embarassed

From Amazon... 

"Developer Token: If you signed up to use Amazon Web Services prior to August 2004, you have a Developer Token. As Developer Tokens are no longer supported and will not work with newer services"

I shall have to look into changing my older apps.

You're also quite right about the affiliate id on the link generation, which is what I had meant by it.

 

Chris

CA-Dev.co.uk 


PreviousBackNext