I do a lot with books in the classes that I teach and I have a pretty extensive library. I joined the Amazon refer program. All of the URL's that point to Amazon have my ID in them. So I create references that look like:

where the string after the ASIN is the ISBN number. Creating these strings by hand is a pain, but the InterWiki link function can help out. I created:
jspwiki.interWikiRef.ISBN = http://www.amazon.com/exec/obidos/ASIN/%s/fosterworld
The %s is replaced with the page reference. The reference would look like:
[ Harry Potter and the Order of the Phoenix|ISBN:043935806X]

Of course a picture of the book cover would be nice. I've been using

<A href="http://www.amazon.com/exec/obidos/ASIN/043935806X/fosterworld">
<IMG src="http://images.amazon.com/images/P/043935806X.01.TZZZZZZZ.jpg" /></A>
to get the cover images.

The next InterWiki link looks like:

jspwiki.interWikiRef.BOOK = http://www.amazon.com/exec/obidos/ASIN/%s/fosterworld">
<IMG src="http://images.amazon.com/images/P/%s.01.TZZZZZZZ.jpg
(all on one line in the property file)
[ Harry Potter and the Order of the Phoenix|BOOK:043935806X]

I had created an image plugin to make it easy to insert images in the page. I then changed it so that it accepted 'isbn' as one of the parameter. To put the cover image on the page it looks like:

[{IMG isbn='043935806X'}]
Of course the other image attributes can be used.

Janne has written a much nicer Image plugin. I took the liberty of hacking it (to death?) to allow for the ISBN. The main guts of the code is:

    result.append( "<tr><td>" );
+   if( link == null && isbn != null)
+   {
+       link = "http://www.amazon.com/exec/obidos/ASIN/" + isbn + "/fosterworld";	 
+   }	
    if( link != null ) 
        result.append("<a href=\""+link+"\">");
+   if( src == null && isbn != null)
+   {
+       src = "http://images.amazon.com/images/P/" + isbn + ".01.TZZZZZZZ.jpg";	 
+   }
    result.append( "<img src=\""+src+"\"" ); 
If there is any interest I can post the entire patch.

Contributed Plugins has more information about plugins

-- Foster Schucker

Add new attachment

Only authorized users are allowed to upload new attachments.
« This page (revision-14) was last changed on 19-Oct-2006 10:17 by JanneJalkanen