Add a bunch of Rael plugins.
[matthijs/upstream/blosxom-plugins.git] / general / google_sitesearch
1 # Blosxom Plugin: google_sitesearch
2 # Author(s): Rael Dornfest <rael@oreilly.com> 
3 # Version: 2.0b4
4 # Documentation: See the bottom of this file or type: perldoc google_sitesearch
5
6 package google_sitesearch;
7
8 # --- Configurable variables -----
9
10 # What text should appear on your Search button?
11
12 # To which domain(s) would you like to restrict your Google SiteSearch?
13 # (Defaults to what you set as your Blosxom $url)
14
15 my $domains = "";
16
17 # What customization bits were included in the "cof" field when 
18 # you signed up for your free Google SiteSearch?
19
20 my $cof = "";
21
22 # --------------------------------
23
24 $searchbox; # use as $google_sitesearch::searchbox in flavour templates
25
26 sub start {
27
28   $domains ||= $blosxom::url;
29   $domains =~ s!^\w+?://!!; # get rid of the http:// bit
30
31   $searchbox = <<"SEARCHBOX";
32 <!-- Search Google -->
33 <form method="GET" action="http://www.google.com/custom">
34 <a href="http://www.google.com/"><img src="http://www.google.com/logos/Logo_40wht.gif" border="0" alt="Google"></a>
35 <br />
36 <input name="q" type="text" size="25" maxlength="255" />
37 <br />
38 <input type="submit" name="sa" value="Google Search" />
39 <input type="hidden" name="domains" value="$domains">
40 <input type="hidden" name="cof" VALUE="$cof">
41 <br>
42 <font face=arial,sans-serif size=-1>
43 <input type="radio" name="sitesearch" value="" checked />Search WWW 
44 <input type="radio" name="sitesearch" value="$domains" />Search $blosxom::blog_title
45 </font>
46 </form>
47 <!-- Search Google -->
48 SEARCHBOX
49   
50   0; # No need to continue; we're done.
51 }
52
53
54 1;
55
56 __END__
57
58 =head1 NAME
59
60 Blosxom Plug-in: google_sitesearch
61
62 =head1 SYNOPSIS
63
64 Provides Google Free SiteSearch [http://www.google.com/services/free.html]
65 for your weblog.
66
67 =head1 INSTALLATION
68
69 Drop the google_sitesearch plug-in into your plugins directory.
70
71 Use $google_sitesearch::searchbox anywhere in your flavour templates you wish.
72
73 =head1 CONFIGURATION
74
75 The google_sitesearch plug-in assumes you've signed up for Google's Free
76 SiteSearch [http://www.google.com/services/free.html] for your site.
77
78 The plug-in will just work out of the box without any configuration.
79 That said, it's probably best to apply any configuration settings you
80 made when you signed up for Google SiteSearch in the Configurable
81 Variables section.
82
83 While $domains defaults to something intelligent -- your Blosxom $url
84 sans the http:// bit -- you might fill in whatever values appear in 
85 the domains field of the form Google created for you when you signed
86 up.
87
88 e.g. <INPUT type=hidden name=domains value="example">
89
90 Simply paste everything between the "" between the "" of $domains in the 
91 Configurable Variables section.
92
93 Also, Google Free SiteSearch allows you to customize the look-and-feel
94 of your results pages.  If you'd like, you can set $cof to the value
95 appearing in the cof field of the form Google created for you when
96 you signed up.
97
98 e.g.  <INPUT type=hidden name=cof VALUE="GIMP:#666666;T:#666666;ALC:#666666;L:http://www.example/images/example.gif;GFNT:#666666;LC:#666666;BGC:#dddddd;AH:center;VLC:#666666;GL:1;S:http://www.example/;GALT:#666666;AWFID:2498b45f59b093e3;">
99
100 Simply paste everything between the "" between the "" of $cof in the 
101 Configurable Variables section.
102
103 =head1 VERSION
104
105 2.0b4-5
106
107 Version number coincides with the version of Blosxom with which the 
108 current version was first bundled.
109
110 =head1 AUTHOR
111
112 Rael Dornfest  <rael@oreilly.com>, http://www.raelity.org/
113
114 =head1 SEE ALSO
115
116 Blosxom Home/Docs/Licensing: http://www.raelity.org/apps/blosxom/
117
118 Blosxom Plugin Docs: http://www.raelity.org/apps/blosxom/plugin.shtml
119
120 =head1 BUGS
121
122 Address bug reports and comments to the Blosxom mailing list 
123 [http://www.yahoogroups.com/group/blosxom].
124
125 =head1 LICENSE
126
127 Blosxom and this Blosxom Plug-in
128 Copyright 2003, Rael Dornfest 
129
130 Permission is hereby granted, free of charge, to any person obtaining a
131 copy of this software and associated documentation files (the "Software"),
132 to deal in the Software without restriction, including without limitation
133 the rights to use, copy, modify, merge, publish, distribute, sublicense,
134 and/or sell copies of the Software, and to permit persons to whom the
135 Software is furnished to do so, subject to the following conditions:
136
137 The above copyright notice and this permission notice shall be included
138 in all copies or substantial portions of the Software.
139
140 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
141 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
142 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
143 THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
144 OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
145 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
146 OTHER DEALINGS IN THE SOFTWARE.