Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mironov/jaconda-api
The official ruby wrapper for Jaconda API
https://github.com/mironov/jaconda-api
Last synced: 3 months ago
JSON representation
The official ruby wrapper for Jaconda API
- Host: GitHub
- URL: https://github.com/mironov/jaconda-api
- Owner: mironov
- License: mit
- Created: 2010-03-07T12:17:42.000Z (almost 15 years ago)
- Default Branch: master
- Last Pushed: 2014-07-04T12:42:18.000Z (over 10 years ago)
- Last Synced: 2024-09-17T01:21:02.141Z (4 months ago)
- Language: Ruby
- Homepage: http://help.jaconda.im/kb/api-v2/jaconda-api-documentation
- Size: 156 KB
- Stars: 10
- Watchers: 4
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.markdown
- License: LICENSE
Awesome Lists containing this project
README
Jaconda API
--------------The official ruby wrapper for working with the [Jaconda REST API](http://help.jaconda.im/kb/api-v2/jaconda-api-documentation)'s JSON interface.
## Installation
gem install jaconda
## Requirements
ActiveResource
## Usage
### Sending notifications
Jaconda::Notification.authenticate(:subdomain => "JACONDA_SUBDOMAIN",
:room_id => "ROOM_ID",
:room_token => "ROOM_TOKEN")Jaconda::Notification.notify(:text => "146 tests, 1399 assertions, 0 failures, 0 errors",
:sender_name => "Build Server")### Using API
Jaconda::API.authenticate(:subdomain => "JACONDA_SUBDOMAIN",
:token => "API_TOKEN")Jaconda::API.authenticate(:subdomain => "JACONDA_SUBDOMAIN",
:email => "EMAIL",
:password => "PASSWORD")#### Finding rooms
Jaconda::API::Room.find(:all)
Jaconda::API::Room.find("support")#### Finding who's available in the room
room = Jaconda::API::Room.find("support")
room.available_users#### Finding who has access to the room
room = Jaconda::API::Room.find("support")
room.presences#### Creating a Room
Jaconda::API::Room.create(:jid => "awesome.project",
:title => "Awesome Project Room")#### Updating a Room
room = Jaconda::API::Room.find("support")
room.topic = "Deadline: 3 apr"
room.save#### Finding messages
room = Jaconda::API::Room.find("support")
room.messages
room.messages(:page => 2)Jaconda::API::Message.find(:all, :params => { :room_id => "support",
:per_page => 100,
:page => 2 })#### Finding messages on date
room = Jaconda::API::Room.find("support")
room.transcript
room.transcript(:date => Date.yesterday)Jaconda::API::Message.transcript(:room_id => "support",
:date => Date.today - 1.month)#### Searching for messages
room = Jaconda::API::Room.find("support")
room.search(:text => "bug")
room.search(:text => "commit", :per_page => 5)Jaconda::API::Message.search(:room_id => "support",
:text => "issue",
:page => 2)#### Saying something
Jaconda::API::Message.create(:room_id => "support",
:text => "Hello from the API!")Jaconda::API::Message.create(:room_id => "support",
:text => "is loving Jaconda!",
:kind => "me")Jaconda::API::Message.create(:room_id => "support",
:text => "Hello from the API!",
:kind => "voice")#### Finding members
Jaconda::API::Member.find(:all)
Jaconda::API::Member.find(123)#### Inviting new member
Jaconda::API::Member.create(:name => "Anton",
:email => "[email protected]")#### Finding uploads
room = Jaconda::API::Room.find("support")
room.uploadsmember = Jaconda::API::Member.find(123)
member.uploads