Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: c002e330f9
Fetching contributors…

Cannot retrieve contributors at this time

60 lines (38 sloc) 1.179 kb

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 'johndoe@hotmail.com', 'password'

    msn.on_login_failed do |reason|
      puts "Oops... #{reason}"
    end

    msn.on_ready do
      msn.set_online_status :online
    end

    msn.on_message do |message|
      puts "Got message from #{message.email}: #{message.text}"

      msn.send_message message.email, "Hi #{message.display_name}!"
    end

    msn.on_contact_request do |email, display_name|
      puts "Contact request from #{display_name} <#{email}>"

      msn.add_contact 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.

Author

Ary Borenszweig

Jump to Line
Something went wrong with that request. Please try again.