Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/atmos/campfiyah
Faraday API for Campfire
https://github.com/atmos/campfiyah
Last synced: 3 months ago
JSON representation
Faraday API for Campfire
- Host: GitHub
- URL: https://github.com/atmos/campfiyah
- Owner: atmos
- License: mit
- Created: 2013-04-09T21:33:52.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2013-10-04T01:48:12.000Z (over 11 years ago)
- Last Synced: 2024-10-07T14:18:39.418Z (3 months ago)
- Language: Ruby
- Size: 309 KB
- Stars: 2
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Campfiyah
A simple faraday backed library for campfire. It comes with an in-memory adapter
to make working with campfire's API in dev/test a lot easier.Given a subdomain and a token, Campfiyah gives you two things.
* List all rooms the token can access on a campfire subdomain
* Send messages to specific rooms## Installation
Add this line to your application's Gemfile:
gem 'campfiyah'
Then require it in your code
```ruby
require 'campfiyah'
```## Usage
```ruby
account = Campfiyah::Account.new(default_subdomain, default_token)
room = account.room_by_name("The Danger Room")
room.message("woot")
```Or you can find rooms by id
```ruby
account = Campfiyah::Account.new(default_subdomain, default_token)
room = account.room_by_id(123456)
room.message("woot")
```Or you can find information on users
```ruby
account = Campfiyah::Account.new(default_subdomain, default_token)
user = account.user_by_id(123456)
user.email
user.name
```You can also enable the in-memory adapter for development or tests.
```ruby
Campfiyah.enable_mock!
```This won't hit the network at all but give you a consistent interface.
## Contributing
1. Create new Pull Request
## WTF is up with the name?
![](https://f.cloud.github.com/assets/38/359743/8b6cc2c0-a16d-11e2-8d90-6b84f53bde79.gif)
**Dylan... Dylan.. Dylan, Dylan, and Dylan. Because I spit hot fiyah.**