Skip to content

Instantly share code, notes, and snippets.

@kraih
Created August 7, 2011 09:51
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save kraih/1130253 to your computer and use it in GitHub Desktop.
use Mojolicious::Lite;
use EV;
use AnyEvent::IRC::Client;
my $c = AnyEvent::IRC::Client->new;
$c->connect('irc.perl.org', 6667, {nick => 'marcus2'});
$c->send_srv(JOIN => '#mojo');
get '/' => sub {
my $self = shift;
my $g =
$c->reg_cb(publicmsg => sub { $self->write_chunk(pop->{params}->[1]) });
$self->on_finish(sub { undef $g });
$self->write_chunk;
};
app->start;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment