gitter-client
Ruby Library for interacting with the Gitter API
Installation
Add this line to your application's Gemfile:
gem 'gitter-client'
And then execute:
$ bundle
Or install it yourself as:
$ gem install gitter-client
Usage
To create a new client:
require 'gitter'
# Create a new client
client = Gitter::Client.new('TOKEN')
The following client methods are available
Rooms
# Get a list of rooms
client.rooms
# Get the users of a specific room
client.room_users('ROOM_ID')
# Get the room channels
client.room_channels('ROOM_ID')
# join a room
client.join_room('chriskacerguis/gitter-client')
Messages
# Get a list of messages
client.('ROOM_ID', limit: 50)
# Send a message
client.('Hello everyone', 'ROOM_ID')
#Update a message
client.('Hello everybody', 'ROOM_ID', 'CHAT_ID')
Users
# Get the current user
client.current_user
# Get the users rooms
client.user_rooms('USER_ID')
# Mark the following chats as read
client.('USER_ID', 'ROOM_ID', ['CHAT_ID1', 'CHAT_ID2'])
# Get unread items and mentions from the room
client.('USER_ID', 'ROOM_ID')
# Get the users organizations
client.user_orgs('USER_ID')
# Get the users repos
client.user_repos('USER_ID')
# Get the users channels
client.user_channels('USER_ID')
Contributing
Note, this library is based off the excellent lib from Kristen Mills, I was unsuccessful in getting in touch with her for changes, so I re-did this using a lot of her things.