Skip to content

Instantly share code, notes, and snippets.

@madmimi
madmimi / gist:269783
Created January 5, 2010 22:06
post to Campfire via new API
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)
Delivered-To: gary@madmimi.com
Received: by 10.141.52.9 with SMTP id e9cs697903rvk;
Thu, 3 Dec 2009 11:00:54 -0800 (PST)
Received: by 10.220.121.155 with SMTP id h27mr2610174vcr.20.1259866853782;
Thu, 03 Dec 2009 11:00:53 -0800 (PST)
Return-Path: <mailman@mimimail6.com>
Received: from mimimail6.com (mimimail6.com [207.210.122.226])
by mx.google.com with ESMTP id 15si2508256yxe.115.2009.12.03.11.00.52;
Thu, 03 Dec 2009 11:00:52 -0800 (PST)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<title>Photojojo</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Language" content="en-us" />
<head>
<style type="text/css">