| Name | Amazon Web Services Plugin |
|---|---|
| Version | 1.0.1 |
| Product Versions | Confluence v2.2.9 to v2.5.1 |
| Author(s) | Garnet R. Chaney |
| Homepage | http://www.bobsgear.com/display/bobsgear/Amazon+Web+Services+Plugin |
| Price | Free postcard-ware |
| License | BSD |
| JavaDocs | |
| IssueTracking | Bobgear project page |
| Download JAR | bobsgear-amazon.1.0.1.jar |
| Download Source | awsmacros.1.0.1.zip |
Description/Features
Make money from Amazon while embedding colorful product pictures within your wiki pages by creating simple links to Amazon books, items, product searches, and wishlists.
Amazon product pictures are a free way to add some spice and pizzazz to your website, and help you make money at the same time.
This Confluence plugin was written as my entry into Atlassian's 2007 Codegeist contest. I think every Confluence wiki should run this plugin, because it has features that are of benefit to every wiki:
- It makes it easy to link to products, pictures and descriptions, relevant to your content
- The source code serves as a great example of many plugin techniques
- Product pictures are a free bandwidth way to add color to your wiki pages
- It will help you make money with your website
- It generates content in a way that should help you grow your wiki web traffic
It's free and open source. If you are interested in learning to write plugins, I hope it will serve as a good example of how to accomplish some tricky things, like making your own system level administration configuration pages, storing your configuration information in the database, properly setting what the breadcrumbs bar shows, and how to grab the title of the page that the macro is being renderd from.
It will also help you make some money from your wiki. I've spent years researching the use of wikis to generate organic search traffic, as well as how to turn those visitors into easy money with Amazon and other affiliate programs.
Most websites, even if they aren't focused on making money, would like to have more visitors. The output of these macros is designed to help your wiki generate more organic (free) search engine traffic. It's well known that google likes quality content, and also to see that your web pages change regularly. So if you use these macros to display relevant products in combination with your own quality content, you should be well on your way to increasing the visitors to your wiki!
Free Postcard-ware
After you've tried this plugin, please send me an email, or a postcard, to let me know what you think of it. This will also help me keep in touch with you about enhancements. I love to tinker with the code that runs my wiki as much as developing the wiki content, so expect to see more great features included in this plugin.
Setup
Download and install this macro using the plugins screen of the System Administration.
After the macro is installed, it adds a System Configuration option, "Amazon Key". Click on this link to go to the configuration screen to configure the plugin for your own Amazon developers key.
If you don't need the money from this plugin...
Of course, you could also support my development of this plugin by leaving this key field blank, in which case my key will be used to generate the content for your site, and I'll receive a few more commissions from Amazon. Unlike some free AWS solutions that force their own key onto your pages for 20% of your website's Amazon requests, my plugin does not do that. Your level of support is totally up to you.
Usage
This plugin includes three macros:
- {asin} for linking to books and items
- {amazonsearch} for showing the results of an Amazon product search.
- {amazonwishlist} for showing the items on an Amazon wishlist
It requires you to get an Amazon Developers Key. A system administration page is provided in the "Configuration" section to set the "Amazon Key". See the section on Setup for more information.
| Important note about server load These macros request live product information from the Amazon Web Services database. Each product you display on your page causes a call to the Amazon Web Services API. An amazon search may cause several calls to Amazon's servers, once for the search, and once for every product shown in the results. All of the information has to be returned before your wiki page can be displayed. Including several product pictures is not a problem, and even including one or two amazon searches or wishlists on a page shouldn't cause much delay. But you probably don't want to list more than a couple dozen products on a single page. If you use these macros like spice, and not the main meal, your content will taste good to users and search engines alike. |
Examples
asin - Linking to an item
asin - Simple product links
- {asin:1861262337} - Link to a book with a 10 digit ISBN number
- {asin:9780470100875} - Link to a book with a 13 digit ISBN number
- {asin:B0001F2MUK} - Link to an Amazon item
|
I like to use these macros with the section and column macros to make a short list of recommended products on the right of my wiki page like this: {section}
{column}
some text goes here.
Some more text goes her.
{column}
{column:width=150}
Two or three recommended books:
* {asin:1861262337} - Link to a book with a 10 digit ISBN number
* {asin:9780470100875} - Link to a book with a 13 digit ISBN number
* {asin:B0001F2MUK} - Link to an Amazon item
{column}
{section}
|
asin - Advanced functionality
The asin macro also supports more advanced functions:
Seeing the raw Amazon XML
- {asin:xmlinfo|1861262337} - Show the XML response from Amazon. Useful for debugging.
- {asin:searchdebug|index|search terms} - Shows raw information received from Amazon
Using asin to do searches and wishlists
- {asin:search|index|keywords} - Same as {amazonsearch:index|keywords}
- Keywords can also be
- ~title - Use the title of the current page as the search argument
- ~randomfromtitle - Use several random words from the current page title
- Keywords can also be
- {asin:wishlist|wishlistid}
To overload, or to make extra macros?
I first developed all these advanced functions within the original {asin} macro, and I have several hundred wiki pages that depend on these overloaded uses of the asin macro. Later I move these to their own classes so I could add each function as the separate macros that follow. The source code for each of these macros is now derived from my own base class that incorporates a lot of functionality common to all of them. See atlassian-plugin.xml for how to easily add more macros to the same plugin.
amazonsearch - Showing results of a search
{amazonsearch:index|keywords}
where,
- index is any of Books, All (Or other Amazon index)
- keywords is one or more space separated words. Or keywords can be either of:
Find books about Java:
{amazonsearch:Books|Java}
Amazon uses the following search indices to divide up all of the items for sale:
|
Apparel |
DVD |
Kitchen |
OutdoorLiving |
Toys |
Note: These are case sensitive, although the plugin will capitalize the first letter if you forget.
You can also search from these blended indexes:
- All—Searches through all search indices. Only five pages of items can be returned where each page contains up to five items.
- Blended—Combines the following search indices: DVD, Electronics, Toys, VideoGames, PCHardware, Tools, SportingGoods, Books, Software, Music, GourmetFood, Kitchen, and Apparel search indices
- Music—Combines Classical, DigitalMusic, and MusicTracks search indices
- Video—Combines DVD and VHS search indices
NOTE: This is index not yet supported:
|
These search index combinations are helpful when you are not sure which search index to specify. The downside of using one of these combined search indices is that they might return quite a few items in the response. - Source
Advanced searches related to the title of your page
If you want to paste a product search macro onto many pages, and have them all show relevant product results, you could custom taylor each macro's search string for best results.
However, if you are lazy like me, and you're faced with 300 new wiki pages that you need some quick place holder content for, you can use either of these keywords to quickly generate relevant product results:
- ~title - Use the title of the current page as the search argument
- ~randomfromtitle - Use several random words from the current page title
{amazonsearch:books|~title} would be the same as typing {amazonsearch:books|Amzon Web Services Plugin}
Since a search for that title isn't likely to find a lot of books, you might also try
{amazonsearch:books|~randomfromtitle}. With this, each time your wiki page is read, a new selection of products for a random subset of words from your page title is returned. For this page it could be strings like "Amazon Services" or "Web Services" or "Web Plugin".
If index is omitted, as in {amazonsearch:java}, the "All" index is assumed.
Example of results for a page 'Examples of choosing random words from page title':

See how the page changes everytime you look at.
amazonwishlist - showing the products on a wishlist
{amazonwishlist:27E0Z5NDGPYHO} wish show the items on the specified wishlist.
Bonus - User macro to link to Amazon
|
If you know the specific book, and it's ISBN number, that you'd like to link to, without calling Amazon web services, here is a user macro for that purpose. I've included it as a user macro, rather than in the core of the plugin, so that you can easily edit it for your own purposes. Think of it as v0.0.1 of my plugin! |
|
Go to the System Administration screen for User Macros. Create new user macro with these settings:
- Macroname: amazonpic
- Do not select "macro has body"
- Output: Macro generates html markup
- Body:
<table><tr><td> <a href="http://www.amazon.com/exec/obidos/ASIN/$paramisbn/webmill0c32-20" target="books"><img src="http://images.amazon.com/images/P/$paramisbn.01.MZZZZZZZ.jpg" border="0" alt="Cover of ISBN $paramisbn"></a></td><td width=120><a href="http://www.amazon.com/exec/obidos/ASIN/$paramisbn/webmill0c32-20" target="books">$paramtitle</a></td></tr></table>
Click save.
You can now use this macro like this:
{amazonpic:title=Double Billing|isbn=0688172229}
|
Using this macro sometimes, and the other macros other times, is a great way to create variety on your pages for your users, and for the search engines. You may want to add an 'align=right' to the table tag so that the output will automatically float to the right so your text can wrap around it. Unless you want to donate the commissions from your clickthroughs to me, be sure to get your own Amazon Associates ID to replace the webmill0c32-20 in the above macro. If you do donate, thanks in advance! |
Version History
- 1.0.0 - May 12, 2007 - Initial entry in the 2007 Codegeist contest.
- 1.0.1 - May 13, 2007 - Add license.txt. Add blank developers key to cause default key to be restored. Include User Macro for linking to a specific product.
Screenshots
|
Screenshots (view as slideshow) |
||||||
|---|---|---|---|---|---|---|
|
|
|
|
||||
|
|
|
|
||||
|
|
||||||


Comments (6)
May 22, 2007
Don Willis says:
A parameter to limit the number of results returned by a search would be nice. S...A parameter to limit the number of results returned by a search would be nice. Some of the results from amazon are extremely lengthy, and having even 3 or 4 long results can be a little overpowering. I guess limiting the size of the individual results would be good too. See my anonymous comment on your example page
May 30, 2007
Garnet R. Chaney says:
Thanks for your comment, I've logged it in jira project for AWSThanks for your comment, I've logged it in jira project for AWS. The next version of the plugin will include this feature and others!
May 22, 2007
Charles Miller says:
You know, you can package user macros directly in {{atlassianplugin.xml}} now: D...You know, you can package user macros directly in atlassian-plugin.xml now: User Macro Plugins
May 24, 2007
Garnet R. Chaney says:
I wasn't sure if including the user macro directly in the plugin would make it e...I wasn't sure if including the user macro directly in the plugin would make it easy for end users to edit the affiliate ID. So I put it here as a user macro to make it very easy for users to change the affiliate ID, as well as tweak the presentation format.
Feb 20
Rolf Lehmann says:
(?) Does anybody know what's up with the WebsiteWould be nice if I could install this Plugin. Copying the JAR to /WEB-INF/lib wasn't the solution. After restarting Confluence the Plugin was not shown in the list of installed Plugins.
Jun 11
CC says:
Hi, Are you planning to add support to a more recent Confluence version ?Hi,
Are you planning to add support to a more recent Confluence version ?