-
-
Save mattyoho/269792 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'httparty' | |
require 'json' | |
class Campfire | |
include HTTParty | |
base_uri 'https://YOUR_DOMAIN.campfirenow.com' | |
basic_auth 'YOUR_API_KEY', 'X' # yes, that is a literal X string. it's needed to satisfy basic_auth(), but campfire ignores it. | |
headers 'Content-Type' => 'application/json' | |
def self.speak(message) | |
body = { | |
:message => { | |
:type => 'TextMessage', | |
:body => message | |
} | |
}.to_json | |
post('/room/YOUR_ROOM_ID/speak.json', {:body => body}) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment