Access Keys:
Skip to content (Access Key - 0)
My Area (Access Key - 2)


Toggle Sidebar
Your Rating: Results: PatheticBadOKGoodOutstanding! 4 rates
Labels:
php php Delete
amazon amazon Delete
opac opac Delete
aleph aleph Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.

Amazon and Aleph OPAC

Tags: , , ,
Last Updated: Oct 30, 2009 00:48


  • Description

    By using the Amazon webservices API you can embedd data from the bookstore in your OPAC. This example pulls Editorial reviews and bookcovers from Amazon based on a ISBN in the bibliographic record.


  • Author: Daniel Forsman
  • Institution: Högskolan i Jönköping
  • Year:
  • 2008

  • License: BSD style
  • Short description: Use, modification and distribution of the code are permitted provided the copyright notice, list of conditions and disclaimer appear in all related material.
  • Link to terms: [Detailed license terms]

  • Skill required for using this code:
    advanced

State

Stable

Programming language

PHP5, Javascript

Software requirements

It is required that you have PHP installed on your Aleph webserver since the AJAX call has to be local due to security.

The Javascript framework Prototype is required for the AJAX (httprequest) call.

Screen captures



Author(s) homepage

http://www.bibl.hj.se

Download

See attachments

Working example

http://julia.hj.se/F/?func=find-b&request=php+oracle+ajax&find_code=WRD&adjacent=N&x=0&y=0&con_lng=eng

Installation instructions

1. Since we are going to use the Amazon Webservices you will need to register an AWS account and obtain a Access Key ID for you application. This requires that you read and accept the terms of use.

2. Download the javascript framework Prototype

3. Make Prototype available in your OPAC. We include it in meta-tags<Code sample>
<script type="text/javascript" src="path_to_where_you_put_it/prototype.js" ></script>
</Code sample>
4. You will need to provide a hook for the ISBN. Repeat the ISBN label (from edit-doc-999) in full-999-body. We don't use the field labels anymore so this is how it looks for us.

If you want the field label then this is a example of including the label, it is just a matter of repeating the variable:

5. You will need to decide where you want the Amazon information to appear. full-set-tail-XXX is where we put it. Add a ID for the amazon content.

6. With a javascript you read the DOM of the page and get the ISBN. Include the Javascript in full-set-tail-XXX. You can include the javascript (amazon.js) like this







or you can write the javascript inline, like in the following examples.




7. The ISBN is now stored in the xisbn variable. The next step is to pass that on to the PHP script that will query AWS. We do that with Prototype.

 8. The PHP script receives the ISBN and passes it on to AWS. The result of the AWS answer is brought back to the OPAC page. Make sure that you include your application ID in the php script.















Tip sample
Info sample


TO DO list

Perhaps include some other data from Amazon... reviews, ratings etc. But that is kind of easy to include if you know about the AWS API, so if you want it look there

Known issues

If you have multiple ISBN (020a|) in your bibliographic view then the last one is the one that gets sent of to Amazon.


Comments




Page Attachments

File NameCommentSizeNumber of Downloads
prototype.js123 kB72
amazon.php1 kB113
amazon.js0.5 kB83

Added by Daniel Forsman on Oct 23, 2008 16:44, last edited by Conf Admin on Oct 30, 2009 00:48

  1. Oct 23, 2008

    This is a nice little blogpost from the Koha developerson the legal side of using AWS.

  2. Aug 19, 2009

    After August 15, 2009 in order to use Amazon's Product Advertising API a timestamp and signature must be included with each request made to Amazon.com. I have updated my production code and will upload it to EC as soon I have verified that it works ok. If you need to do something about it right away please contact me or look here: http://forums.digitalpoint.com/showthread.php?t=1366791, I also found the Signed Requests Helper useful : http://associates-amazon.s3.amazonaws.com/signed-requests/helper/index.html

Adaptavist Theme Builder Powered by Atlassian Confluence