openfire_api¶ ↑
a ruby client for openfire’s user_service, room_service and group_service api
{<img src=“gravatar.com/avatar/babu3009?size=50” />}
Installation¶ ↑
In your Gemfile
gem "openfire_api_ruby"
or
gem install openfire_api_ruby
Usage¶ ↑
## create a new userservice object
api = OpenfireApiRuby::UserService.new(:url => "http://localhost:9090/", :secret => "BIGSECRET")
register new user
api.add_user!(:username => "user", :password => "pass") api.add_user!(:username => "user", :password => "pass", :name => ..., :email => ..., :groups => ...)
update existing user
api.update_user!(:username => "user", :password => "pass") api.update_user!(:username => "user", :password => "pass", :name => ..., :email => ..., :groups => ...)
delete user
api.delete_user!(:username => "user")
lock user
api.lock_user!(:username => "user")
unlock user
api.unlock_user!(:username => "user")
## create a new roomservice object
api = OpenfireApiRuby::RoomService.new(:url => "http://localhost:9090/", :secret => "BIGSECRET")
create a new room
api.add_room!(:roomname => "room", :jid => "jid", :subdomain => "groupchat")
delete a room
api.delete_room!(:roomname => "room", :subdomain => "groupchat")
create a muc service
api.add_muc_service!(:subdomain=>'demo-service', :description=>'this is a demo muc service')
delete a muc service
api.delete_muc_service!(:subdomain=>'demo-service')