Skip to content

@ironcamel /freenode.yml
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
IRC bot that notifies via libnotify popups and festival text-to-speech converter
conn_info:
server: irc.freenode.net
port: 6667
channels:
- '#foo'
- '#bar'
nick: foobot
username: foobot
name: defender of the universe
ignore_list:
- redbot
- robot
- srjk
charset: utf-8
#ssl: 1
#!/usr/bin/env perl
package IronBot;
use base qw(Bot::BasicBot);
use strict;
use warnings;
use YAML::XS qw(LoadFile);
die "usage: $0 config.yml\n" unless @ARGV;
# Callback that gets called whenever something is said
sub said {
my ($self, $params) = @_;
my ($body, $who, $channel) = @$params{qw(body who channel)};
open my $festival, '| festival --tts';
print $festival "$body\n";
system 'notify-send', "$channel - $who", $body;
return;
}
my $bot = IronBot->new(%{LoadFile($ARGV[0])->{conn_info}});
$bot->run();
@ironcamel
Owner

To install dependencies:
cpan Bot::BasicBot POE::Component::SSLify
aptitude install libnotify-bin festival

POE::Component::SSLify is only needed if you want to connect to an irc server via ssl.

Usage:
./ironbot freenode.yml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.