em-msn
MSN client (EventMachine + Ruby)
Project Pages
Usage
Installation
gem install em-msn
Gemfile
gem 'em-msn'
Example
require 'rubygems'
require 'em-msn'
EM.run do
EM.schedule do
msn = Msn::Messenger.new '[email protected]', 'password'
msn.on_login_failed do |reason|
puts "Oops... #{reason}"
end
msn.on_ready do
msn.set_online_status :online
end
msn. do ||
puts "Got message from #{.email}: #{.text}"
msn. .email, "Hi #{.display_name}!"
end
msn.on_contact_request do |email, display_name|
puts "Contact request from #{display_name} <#{email}>"
msn.add_to_friends_list email
msn.add_to_allowed_list email
end
msn.connect
end
end
Contributions
All contributions are welcome. The gem doesn't have many tests and a lot of things can be improved, as some parts of the protocol are not yet implemented.