Created
June 24, 2009 07:21
-
-
Save matthewtodd/135069 to your computer and use it in GitHub Desktop.
iChat-spam Bonjour accounts by name
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
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