-
-
Save ripienaar/708134 to your computer and use it in GitHub Desktop.
This file contains 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
#!/usr/bin/env ruby | |
# | |
# This script reads lines from STDIN and sends a notification for each line. | |
# It's intended to be used with the fnotify.pl IRSSI script to write notices | |
# and hilights to a plain text file. tail -f links the two systems together. | |
require 'mcollective' | |
include MCollective::RPC | |
Signal.trap(:TERM) { exit; } | |
angelia = rpcclient("angelianotify") | |
# from 1.0.0 if you have multiple angelia servers this will | |
# pick one of them only | |
# angelia.limit_targets=1 | |
$stdin.each_line do |line| | |
angelia.sendmsg(:recipient => "boxcar://[email protected]", :subject => "IRC Notify", :message => line, :process_results => false) | |
angelia.sendmsg(:recipient => "xmpp://[email protected]", :subject => "IRC Notify", :message => line, :process_results => false) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment