Skip to content

Instantly share code, notes, and snippets.

@matthewtodd
Created June 24, 2009 07:21
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 matthewtodd/135069 to your computer and use it in GitHub Desktop.
Save matthewtodd/135069 to your computer and use it in GitHub Desktop.
iChat-spam Bonjour accounts by name
require 'appscript'
class DeployNotifier
include Appscript
def initialize(*names)
@ichat = app('iChat')
@accounts = names.map { |name| bonjour_account(name) }
end
def spam(message)
@accounts.each { |account| send_spam(message, account) }
end
private
def bonjour_account(name)
@ichat.services['Bonjour'].accounts[name]
end
def send_spam(message, account)
@ichat.send_(message, :to => @account)
rescue
$stderr.puts "Error spamming #{account}."
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment