Guest User

Untitled

a guest
Jul 20th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. #+ Auto::Notify {
  2. # mask: *@*
  3. # keyword: foo,bar,baz
  4. # blocks: notifo
  5. # notifo {
  6. # type: notifo
  7. # api-key: yourapikey
  8. # user: yourusername
  9. # format: #(nick.now): #(text)
  10. # }
  11. #}
  12.  
  13. sub config_notifo {
  14. my ($this, $config) = @_;
  15.  
  16. 1;
  17. }
  18.  
  19. sub send_notifo {
  20. my ($this, $config, $text, $msg, $sender, $full_ch_name) = @_;
  21.  
  22. require WebService::Notifo;
  23. $text = Auto::AliasDB->stdreplace(
  24. $msg->prefix,
  25. $config->format || $this->config->format || '[tiarra][#(channel):#(nick.now)] #(text)',
  26. $msg, $sender,
  27. channel => $full_ch_name,
  28. raw_channel => Auto::Utils::get_raw_ch_name($msg, 0),
  29. text => $this->strip_mirc_formatting($text),
  30. );
  31. WebService::Notifo->new(
  32. api_key => $config->api_key,
  33. user => $config->user,
  34. )->send_notification(
  35. title => 'Keyword found',
  36. label => 'Tiarra',
  37. msg => Tiarra::Encoding->new($text, 'jis')->utf8,
  38. );
  39. }
Add Comment
Please, Sign In to add comment