1 # Blosxom Plugin: google_highlight
3 Blosxom Home/Docs/Licensing: http://blosxom.sourceforge.net/
5 Blosxom Plugin Docs: http://blosxom.sourceforge.net/documentation/users/plugins.html
6 # Author(s): Rael Dornfest <rael@oreilly.com>
8 # Documentation: See the bottom of this file or type: perldoc google_highlight
10 package google_highlight;
12 # --- Configurable variables -----
14 # none, null, nada, nothing, zip, zero, zilch
16 # --------------------------------
21 my $referer = $ENV{'HTTP_REFERER'};
23 ($query) = $referer =~ m#^http://(?:www\.)?google.*q=([^\&]+)#i or return 0;
25 $query = join '|', split /[\s,\+\.]+/, $query;
31 my($pkg, $path, $filename, $story_ref, $title_ref, $body_ref) = @_;
33 $$body_ref =~ s#(?<=>)([^<]+)?\b($query)\b#$1<span class="highlight">$2</span>#gis;
42 Blosxom Plug-in: google_highlight
46 Highlights any Google search terms used to find your weblog.
48 An adaptation of Dean Allen's [http://www.textism.com/] Google
49 Hilite [http://www.textism.com/tools/google_hilite/].
57 Rael Dornfest <rael@oreilly.com>, http://www.raelity.org/
59 This plugin is now maintained by the Blosxom Sourceforge Team,
60 <blosxom-devel@lists.sourceforge.net>.
64 Drop the interpolate_fancy plug-in into your Blosxom plugins folder.
66 Add a "highlight" style to your document or CSS style sheet, e.g.:
71 .highlight { background-color: #FF9; }
81 Search Google for something that'll lead you to your weblog. Follow
82 the Google link and notice the terms used in your search are highlighted
87 Blosxom Home/Docs/Licensing: http://blosxom.sourceforge.net/
89 Blosxom Plugin User Docs:
90 http://blosxom.sourceforge.net/documentation/users/plugins.html
92 Blosxom Plugin Developer Docs:
93 http://blosxom.sourceforge.net/documentation/developers/plugins.html
95 Dean Allen's Textism [http://www.textism.com/]
96 Dean Allen's Google Hilite [http://www.textism.com/tools/google_hilite/]
100 None known; please send bug reports and feedback to the Blosxom
101 development mailing list <blosxom-devel@lists.sourceforge.net>.
105 Blosxom and this Blosxom Plug-in
106 Copyright 2003, Rael Dornfest
108 Permission is hereby granted, free of charge, to any person obtaining a
109 copy of this software and associated documentation files (the "Software"),
110 to deal in the Software without restriction, including without limitation
111 the rights to use, copy, modify, merge, publish, distribute, sublicense,
112 and/or sell copies of the Software, and to permit persons to whom the
113 Software is furnished to do so, subject to the following conditions:
115 The above copyright notice and this permission notice shall be included
116 in all copies or substantial portions of the Software.
118 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
119 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
120 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
121 THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
122 OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
123 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
124 OTHER DEALINGS IN THE SOFTWARE.