Updated to deal with multiple keywords.
This patch enables the new google tags.
The codebase has been updated with this.
Add four lines to sub makelinks (adjacent the cpan lines):
$content=~s/\[google:\/\/([^|\]]+)\|([^\]]+)\]/&google('G',$1,$2)/eig;
+ # [google://keyword(s)|text]
$content=~s/\[google:\/\/([^|\]]+)\]/&google('G',$1)/eig;
+ # [google://keyword(s)]
$content=~s/\[lucky:\/\/([^|\]]+)\|([^\]]+)\]/&google('L',$1,$2)/eig;
+ # [lucky://keyword(s)|text]
$content=~s/\[lucky:\/\/([^|\]]+)\]/&google('L',$1)/eig;
+ # [lucky://keyword(s)]
Add this subroutine after sub makelinks:
sub google
{ # [google://] and [lucky://]
my$google = 'http://www.google.com/search?q=';
my$luck = '&btnI=lucky';
my($fu,$g,$n) = shift;
if($fu eq 'G'){ undef($luck) }
$n = CGI::escape($_[0]);
if(@_ == 2){
$g = qq~<a href="$google$n$luck"$trgt>$_[1]<\/a>~;
}
if(@_ == 1){
$g = qq~<a href="$google$n$luck"$trgt>$_[0]<\/a>~;
}
return $g;
}