README
1NAME
2 POE::Component::IRC::Plugin::QueryDNSBL - A POE::Component::IRC plugin
3 for IRC based DNSBL queries
4
5VERSION
6 version 1.04
7
8SYNOPSIS
9 use strict;
10 use warnings;
11 use POE qw(Component::IRC Component::IRC::Plugin::QueryDNSBL);
12
13 my $nickname = 'qdnsbl' . $$;
14 my $ircname = 'QueryDNSBL Bot';
15 my $ircserver = $ENV{IRCSERVER} || 'irc.bleh.net';
16 my $port = 6667;
17 my $channel = '#IRC.pm';
18
19 my $irc = POE::Component::IRC->spawn(
20 nick => $nickname,
21 server => $ircserver,
22 port => $port,
23 ircname => $ircname,
24 debug => 0,
25 plugin_debug => 1,
26 options => { trace => 0 },
27 ) or die "Oh noooo! $!";
28
29 POE::Session->create(
30 package_states => [
31 'main' => [ qw(_start irc_001) ],
32 ],
33 );
34
35 $poe_kernel->run();
36 exit 0;
37
38 sub _start {
39 # Create and load our QueryDNSBL plugin
40 $irc->plugin_add( 'QueryDNSBL' =>
41 POE::Component::IRC::Plugin::QueryDNSBL->new() );
42
43 $irc->yield( register => 'all' );
44 $irc->yield( connect => { } );
45 undef;
46 }
47
48 sub irc_001 {
49 $irc->yield( join => $channel );
50 undef;
51 }
52
53DESCRIPTION
54 POE::Component::IRC::Plugin::QueryDNS is a POE::Component::IRC plugin
55 that provides DNSBL query facilities to the channels it occupies and via
56 private messaging.
57
58 It uses POE::Component::Client::DNSBL to do non-blocking DNSBL queries.
59 By default the plugin attempts to use POE::Component::IRC's internal
60 PoCo-Client-DNS resolver object, but will spawn its own copy. You can
61 supply your own resolver object via the constructor.
62
63CONSTRUCTOR
64 "new"
65 Creates a new plugin object. Takes some optional parameter:
66
67 'command', define the command that will trigger DNSBL queries, default is 'dnsbl';
68 'privmsg', set to a true value to specify that the bot should reply with PRIVMSG instead of
69 NOTICE to privmsgs that it receives.
70 'resolver', specify a POE::Component::Client::DNS object that the plugin should use,
71 the default is to try and use POE::Component::IRC's resolver;
72 'dnsbl', the DNSBL zone to send queries to, default zen.spamhaus.org;
73
74IRC USAGE
75 The bot replies to requests in the following form, when addressed:
76
77 dnsbl <ipv4_address>
78
79 Of course, if you changed the "command" in the constructor it will be
80 something different to "dns".
81
82SEE ALSO
83 POE::Component::Client::DNSBL
84
85 <http://en.wikipedia.org/wiki/DNSBL>
86
87AUTHOR
88 Chris Williams <chris@bingosnet.co.uk>
89
90COPYRIGHT AND LICENSE
91 This software is copyright (c) 2011 by Chris Williams.
92
93 This is free software; you can redistribute it and/or modify it under
94 the same terms as the Perl 5 programming language system itself.
95
96