AmazonJackets

Extension Information
Extension File Name: 
AmazonJackets.js
Author: 
Richard Wallis
Extension Class Name: 
AmazonJackets
Function Parameters: 

 Constructor arguments:
arg: juice - instance of juice
arg: insert - JuiceInsert for page
arg: targetDiv - id of div element on page in which to insert jacket image
arg: opts - Controlling arguments for image display
Default opts being: 
 
location : "01",
collection : "images",
command: "_SCLZZZZZZZ_"
 
 
 

Example Code: 

         if(juice.hasMeta('isbns')){
                var div = '<tr><td><div style="float: right; margin-bottom: -200px; margin-right: 10px;" id="jack"></div></td></tr>';
                var insert = new JuiceInsert(div,"#jackrow","before");
                new AmazonJackets(juice,insert,"jack");
        }
 

This extension will insert a bockjacket image on to a page.  It uses the 'isbns' meta value to capture an, ISBN10, value to pass to the src element of the img element it inserts.
This is not a sophisticated extension.  It relies upon observed patterns in Amazon URLs with help from this blog post. 
WARNING: Amazon.com have usage terms defined on their site.  Just inserting an image on a page may contravene these terms.  You may have to include links to Amazon services to comply with their terms.
 

AttachmentSize
AmazonJackets.js.txt1.22 KB
AmazonJackets in Talis Prism2