import httplib2 def _send_campfire_message(message): """Send message to Campfire using your campfire login""" # SETUP: go to http://.campfirenow.com/member/edit # put your api key in ~/.fabricrc like: # campfire_api_key = abafdc8391ae67ce829accc9198df832f5f821eb13cac9fb if env.has_key('campfire_api_key'): data = '{"message":{"body":"-- %s --"}}' % message conn = httplib2.Http(timeout=3) conn.add_credentials(env.campfire_api_key, 'X') headers = {'content-type':'application/json'} url = "http://-bc.campfirenow.com/room//speak.json" conn.request(url, "POST", data, headers)