Another Update (Sept. 3, 2004): I’ve added a category for the amazon plugin that’ll list all relevant posts so I don’t have to keep going back and adding these stupid updates. Be sure to read all posts in the category for complete details.
Update (Aug. 16, 2004): I’ve added some functionality and fixed a bug. Check here for details.
I’ve just written my first WordPress plugin. Actually, I had previously modified the acronym plugin to allow me to specify some common words that should always be associated with links (only later did I notice that the author of the original plugin had already done just this). Amazon Wishlist is my first original plugin, though, and even at that, the bulk of the code isn’t mine. I found a fairly concise script that interfaces with the Amazon API and another that actually handles making the connection, and I wrapped some code around the results to make it all into a nice configurable plugin for WordPress. Incidentally, there is another Amazon plugin here that allows you very easily to browse books and insert them into your entries. Very nifty, but it serves a different purpose.
Installation
You have only to download the plugin, stick it in your wp-content/plugins directory, edit a few variables, optionally add some style sheet definitions, and activate the plugin using your control panel. Straight from the code itself:
[php]
$aw_dev_token=”; //Get this from http://www.amazon.com/gp/aws/landing.html.
$aw_associates_id=”; //Optional; set to empty string if not applicable.
$aw_type=’lite’; //could also be heavy, though it doesn’t seem to make a difference in the search results.
$aw_wishlist_id=”; //The id of the wish list you wish to search. Hint: Search for (don’t simply go to) your wish list and copy the id from the end of the URL.
$aw_header=’Amazon Wish List’; //Used to label the box.
$aw_show_author = 1; //Set to 0 to suppress.
$aw_image_size = ‘Medium’; //’Small,’ ‘Medium,’ or ‘Large’
$aw_show_price = 1; //Set to 0 to suppress.
[/php]
Here’s hoping it’s not buggy and that it helps somebody out. You can see it in action in my sidebar.