Created
January 18, 2011 08:38
-
-
Save yoshiki/784140 to your computer and use it in GitHub Desktop.
For using notifo on tiarra
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#+ 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