Kwiki::DMOZLink - Create a link to DMOZ.org from your Kwiki


Kwiki-DMOZLink documentation Contained in the Kwiki-DMOZLink distribution.

Index


Code Index:

NAME

Top

Kwiki::DMOZLink - Create a link to DMOZ.org from your Kwiki

Version

Top

Version 0.01

Synopsis

Top

Creates a link to search DMOZ.org for the term.

For example:

    Search DMOZ for: (dmoz:Kwiki)




Author

Top

Steve Peters, <steve@fisharerojo.org>

Credit

Top

Michael Gray's useful Kwiki::GoogleLink gave me much of the inspiration (and code) for this module. See http://www.kwiki.org/index.cgi?KwikiGoogleLinkPlugin

TODO

Top

This needs more tests for me to feel really comfortable with.

Bugs

Top

Please report any bugs or feature requests to bug-kwiki-dmozlink@rt.cpan.org, or through the web interface at http://rt.cpan.org. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

Copyright & License

Top


Kwiki-DMOZLink documentation Contained in the Kwiki-DMOZLink distribution.

package Kwiki::DMOZLink;

use warnings;
use strict;

use Kwiki::Plugin '-Base';

our $VERSION = 0.01;

const class_title => 'DMOZ Search Link';
const class_id => 'dmoz_link';

sub register {
    my $registry = shift;
    $registry->add(wafl => dmoz => 'Kwiki::DMOZLink::Wafl');
}

package Kwiki::DMOZLink::Wafl;
use Spoon::Formatter;
use base qw(Spoon::Formatter::WaflPhrase);

const dmoz_search => 'http://search.dmoz.org/cgi-bin/search?search=';

sub html {
    my $search = $self->arguments;
    join('', 
	 '<a href="', 
          $self->dmoz_search, 
          $self->uri_escape($search), '">',
	  $self->html_escape($search), '</a>'
 	);
}

1;