The eventmachine-based implementation of the OSCAR protocol (AIM, ICQ)
Add this line to your application's Gemfile:
gem 'icq'
And then execute:
$ bundle
Or install it yourself as:
$ gem install icq
Connects to ICQ as user 123456 and puts all recived messages
client = Icq::Client.new(uin: '123456', password: 'SECURE_PASSWORD')
client.on_message do |username, text|
puts username: username, text: text
end
client.start
Icq.configure do |config|
config.server = 'login.icq.com'
config.port = 5190
end
client = Icq::Client.new(uin: '123456', password: 'SECURE_PASSWORD')
client.start
client = Icq::Client.new(uin: '123456', password: 'SECURE_PASSWORD')
client.on_auth_error do |code, c|
puts %s(auth-error) => '0x%02x' % code
end
client.on_connection_error do
puts 'connection-error'
end
client.start
Code in this callback will be executed every 2 seconds
client = Icq::Client.new(uin: '123456', password: 'SECURE_PASSWORD')
client.on_timer(2) do
puts "Executing timer event: #{Time.now}"
end
client.start
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
Hardcore EM-based code from here: https://github.com/devmod/em-oscar