Skip to content

Instantly share code, notes, and snippets.

@ajsharp
Created December 18, 2009 05:06
Show Gist options
  • Save ajsharp/259303 to your computer and use it in GitHub Desktop.
Save ajsharp/259303 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'yaml'
require 'net/http'
require 'uri'
require 'json'
require 'httparty'
class NotifyCampfire
include HTTParty
def self.config
@config ||= YAML.load_file(File.dirname(File.expand_path(__FILE__)) + "/settings.yml")
end
base_uri "#{config["subdomain"]}.campfirenow.com"
headers 'Content-type' => 'application/json'
basic_auth config["token"], "X"
format :json
def self.notify(message)
opts = { :query => { :message => { :body => message } } }
resp = post("/room/#{config["room"]}/speak.json", opts)
puts resp.inspect
end
end
NotifyCampfire.notify("testing...")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment