I have included a .inc file that provides provide details from amazon web services and creates a book node. The problem is that when I click the 'lookup' button the web page goes blank, on clicking the return button on the broswer the results for the search are displayed in the appropriate boxes but again once i click on the 'Create' the web page goes blank and the book node is not created. I have attched my code, I cannot seem to find what is wrong. Please can you help? Thanks

Comments

Abi-1’s picture

Title: Aazon Web Services » Amazon Web Services
brevity’s picture

Status: Active » Closed (fixed)

Thanks for that! When I remove the the "? >" at the end of the .inc it works for me! These blank screens (possibly triggered by trailing whitespace (?) are a somewhat often seen/well known Drupal issue...)

[edit] You might change the amazonresults array keys to ease mapping process to cck fields, eg:

"title" => ...
"authors" => ...
"Publisher" => ...
"Year" => ...

asb’s picture

Status: Closed (fixed) » Active

Using this operator as operator_amazon.inc results in:

warning: simplexml_load_file(http://ecs.amazonaws.com/onca/xml?Service=AWSECommerceService&AssociateTag=My%20Tag&AWSAccessKeyId=MY%20KEY&Operation=ItemSearch&Version=2008-08-19&SearchIndex=Books&Keywords=johannes%20brahms&ResponseGroup=ItemAttributes) [function.simplexml-load-file]: failed to open stream: HTTP request failed! HTTP/1.1 400 Bad Request in /var/www/drupal/sites/all/modules/createfromweb/operator_amazon.inc on line 31.
warning: simplexml_load_file() [function.simplexml-load-file]: I/O warning : failed to load external entity "http://ecs.amazonaws.com/onca/xml?Service=AWSECommerceService&AssociateTag=My%20Tag&AWSAccessKeyId=MY%20KEY&Operation=ItemSearch&Version=2008-08-19&SearchIndex=Books&Keywords=johannes%20brahms&ResponseGroup=ItemAttributes" in /var/www/drupal/sites/all/modules/createfromweb/operator_amazon.inc on line 31.
amazon: no file upload
warning: Invalid argument supplied for foreach() in /var/www/drupal/sites/all/modules/createfromweb/operator_amazon.inc on line 38.

What's going wrong?

brevity’s picture

opening that url says MissingParameterThe request must contain the parameter Signature.

do u have an own amazon api key -- i guess u have to specify some credentials in the amazon operator inc

asb’s picture

Yes, and I put in into $AccessKey = 'MY KEY';. Probably something else is invalid, e.g. $Version = "2008-08-19"; ... well, or most probably anything else ;-(

alvinlb’s picture

Did you specify the AWS Access key AND the AWS secret key?

asb’s picture

@alvinlb (#6):

> Did you specify the AWS Access key AND the AWS secret key?

I believe so. But after reading https://aws-portal.amazon.com/gp/aws/developer/account/index.html?ie=UTF... I'm not so sure anymore, what keys I have for which Amazon service, and which would be valid for this "Create from Web" operator. When logging in at aws.amazon.com, they try to force me to create an EC2 account, there is no "settings" where I could look up the key.

http://s3.amazonaws.com/mturk/tools/pages/aws-access-identifiers/aws-ide... points me to http://www.amazonaws.com which redirects to a registration form. That one allows me to log in as a previous user and then tells me "We noticed you previously created an Amazon Web Services account." Indeed, but it doesn't tell any available keys.

So basically I have no idea how to verify that fu***** key.

Greetings, -asb

alvinlb’s picture

Hey asb,

if you log in here

https://www.amazon.com/ap/signin?openid.ns=http%3A%2F%2Fspecs.openid.net...

you should go straight to your security credentials page? Which should show you your access key id and your secret access key?

alvinlb’s picture

StatusFileSize
new3.5 KB

asb,

with the operator attached above by abi, i get the same error..

try with this one..

asb’s picture

Status: Active » Fixed

@alvinlb:

Thanks, the operator from #9 works like a charm:

executing amazon_keywords with: Johannes Brahms
multiple results: 10
...

Niiiiice!
-asb

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.