Skip to content

Instantly share code, notes, and snippets.

@ripienaar
Forked from jeffmccune/irc_notify_loop.rb
Created November 20, 2010 20:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ripienaar/708134 to your computer and use it in GitHub Desktop.
Save ripienaar/708134 to your computer and use it in GitHub Desktop.
#!/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://you@your.com", :subject => "IRC Notify", :message => line, :process_results => false)
angelia.sendmsg(:recipient => "xmpp://you@your.com", :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