summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2009-11-26 00:51:23 -0600
committerJesse Luehrs <doy@tozt.net>2009-11-26 00:51:23 -0600
commit0bad6682d0c6a747fd10e38465939c79930238d0 (patch)
tree7c9895b976cfce1969ede95e77c5783cca5f7768
parentb2c70c0cba3338f698b66e334e293c14bfd68cf0 (diff)
downloadcrawlbot-0bad6682d0c6a747fd10e38465939c79930238d0.tar.gz
crawlbot-0bad6682d0c6a747fd10e38465939c79930238d0.zip
fix b::bb config a bit
-rw-r--r--bin/run2
-rw-r--r--lib/Crawl/Bot.pm12
2 files changed, 10 insertions, 4 deletions
diff --git a/bin/run b/bin/run
index 2555c09..5ce0f74 100644
--- a/bin/run
+++ b/bin/run
@@ -8,6 +8,4 @@ Crawl::Bot->new(
server => 'irc.freenode.net',
channels => ['##crawl-dev'],
nick => 'crawl-dev',
- username => 'crawl-dev',
- name => 'crawl-dev',
)->run;
diff --git a/lib/Crawl/Bot.pm b/lib/Crawl/Bot.pm
index e6a5e15..ccaa29e 100644
--- a/lib/Crawl/Bot.pm
+++ b/lib/Crawl/Bot.pm
@@ -6,6 +6,14 @@ extends 'Bot::BasicBot';
use autodie;
use XML::RAI;
+has [qw(username name)] => (
+ # don't need (or want) accessors, just want to initialize the hash slot
+ # for B::BB to use
+ is => 'bare',
+ isa => 'Str',
+ default => sub { shift->nick },
+);
+
has rss_feed => (
is => 'ro',
isa => 'Str',
@@ -91,9 +99,9 @@ sub tick {
return if $self->has_item($id);
warn "New issue! ($id)";
$self->say(
- channel => '##crawl-dev',
+ channel => $_,
body => $item->title . ' (' . $item->link . ')'
- );
+ ) for $self->channels;
$self->add_item($id);
});
$self->save_cache;