1 # Blosxom Plugin: buy_from_amazon
2 # Author(s): Rael Dornfest <rael@oreilly.com>
4 # Documentation: See the bottom of this file or type: perldoc buy_from_amazon
6 package buy_from_amazon;
8 # --- Configurable variables -----
10 # What is your Amazon Associate ID?
11 my $associate_id = "raelitybytes-20";
12 # If you're not an Amazon Associate, feel free to leave this as is ;-)
14 # --------------------------------
16 $amazon; # use as $buy_from_amazon::amazon in flavour templates
23 my($pkg, $path, $filename, $story_ref, $title_ref, $body_ref) = @_;
25 ($amazon) = $$body_ref =~ m!['"]http://www.amazon.com.+?/(\w+)/$associate_id.*?['"]!mg;
27 $amazon and $amazon = qq{<a href="http://buybox.amazon.com/exec/obidos/redirect?tag=$associate_id&link_code=xsc&creative=23424&camp=2025&path=/dt/assoc/tg/aa/xml/assoc/-/$amazon/$associate_id/ref=ac_bb6_,_amazon" onclick="window.open(this.href, 'buy from amazon', 'location=yes,scrollbars=yes,status=yes,toolbar=yes,resizable=yes,width=380,height=450,screenX=10,screenY=10,top=10,left=10'); return false;">buy from amazon</a>};
38 Blosxom Plug-in: buy_from_amazon
42 Purpose: Populates $buy_from_amazon::amazon with a link to
43 Amazon Quick Click(TM) Buying for the first Amazon product
44 link (if any) found in the current weblog story body.
50 Version number coincides with the version of Blosxom with which the
51 current version was first bundled.
55 Rael Dornfest <rael@oreilly.com>, http://www.raelity.org/
59 Blosxom Home/Docs/Licensing: http://www.raelity.org/apps/blosxom/
61 Blosxom Plugin Docs: http://www.raelity.org/apps/blosxom/plugin.shtml
65 Address bug reports and comments to the Blosxom mailing list
66 [http://www.yahoogroups.com/group/blosxom].
70 Blosxom and this Blosxom Plug-in
71 Copyright 2003, Rael Dornfest
73 Permission is hereby granted, free of charge, to any person obtaining a
74 copy of this software and associated documentation files (the "Software"),
75 to deal in the Software without restriction, including without limitation
76 the rights to use, copy, modify, merge, publish, distribute, sublicense,
77 and/or sell copies of the Software, and to permit persons to whom the
78 Software is furnished to do so, subject to the following conditions:
80 The above copyright notice and this permission notice shall be included
81 in all copies or substantial portions of the Software.
83 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
84 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
85 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
86 THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
87 OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
88 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
89 OTHER DEALINGS IN THE SOFTWARE.