Skip to content

Instantly share code, notes, and snippets.

@yoshiki
Created January 18, 2011 08:38
Show Gist options
  • Save yoshiki/784140 to your computer and use it in GitHub Desktop.
Save yoshiki/784140 to your computer and use it in GitHub Desktop.
For using notifo on tiarra
#+ Auto::Notify {
# mask: *@*
# keyword: foo,bar,baz
# blocks: notifo
# notifo {
# type: notifo
# api-key: yourapikey
# user: yourusername
# format: #(nick.now): #(text)
# }
#}
sub config_notifo {
my ($this, $config) = @_;
1;
}
sub send_notifo {
my ($this, $config, $text, $msg, $sender, $full_ch_name) = @_;
require WebService::Notifo;
$text = Auto::AliasDB->stdreplace(
$msg->prefix,
$config->format || $this->config->format || '[tiarra][#(channel):#(nick.now)] #(text)',
$msg, $sender,
channel => $full_ch_name,
raw_channel => Auto::Utils::get_raw_ch_name($msg, 0),
text => $this->strip_mirc_formatting($text),
);
WebService::Notifo->new(
api_key => $config->api_key,
user => $config->user,
)->send_notification(
title => 'Keyword found',
label => 'Tiarra',
msg => Tiarra::Encoding->new($text, 'jis')->utf8,
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment