| 1 | package Kwiki::GoogleLink; | ||
| 2 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 1 | ▶ | use Kwiki::Plugin '-Base'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 1 | ▶ | |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 1 | our $VERSION = 0.01; | |
| 7 | |||
| 8 | 1 | const class_title => 'Google Search Link'; | |
| 9 | 1 | const class_id => 'google_link'; | |
| 10 | |||
| 11 | 0 | ▶ | sub register { |
|
Subroutine
register: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 12 | 0 | my $registry = shift; | |
| 13 | 0 | $registry->add(wafl => google => 'Kwiki::GoogleLink::Wafl'); | |
| 14 | } | ||
| 15 | |||
| 16 | package Kwiki::GoogleLink::Wafl; | ||
| 17 | 1 | ▶ | use Spoon::Formatter (); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 18 | 1 | ▶ | use base 'Spoon::Formatter::WaflPhrase'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 19 | |||
| 20 | 1 | const google_search => 'http://www.google.com/search?q='; | |
| 21 | |||
| 22 | 0 | ▶ | sub html { |
|
Subroutine
html: not called CC=1 SCAR=6.9
| |||
| 23 | 0 | my $search = $self->arguments; | |
| 24 | 0 | join('', | |
| 25 | '<a href="', | ||
| 26 | $self->google_search, | ||
| 27 | $self->uri_escape($search), '">', | ||
| 28 | $self->html_escape($search), '</a>' | ||
| 29 | ); | ||
| 30 | } | ||
| 31 | |||
| 32 | 1 | 1; | |
| 33 | |||
| 34 | 1 | __DATA__ | |