Skip to content

Instantly share code, notes, and snippets.

@gisikw
Created August 16, 2009 11:30
Show Gist options
  • Save gisikw/168605 to your computer and use it in GitHub Desktop.
Save gisikw/168605 to your computer and use it in GitHub Desktop.
require 'net/http'
require 'rubygems'
require 'xmlsimple'
PROJECT_ID = something
TOKEN = something
HOST = "www.pivotaltracker.com"
URL = "/services/v2/projects/#{PROJECT_ID}/stories"
def new_story(params)
xml = XmlSimple.xml_out(params).gsub(/<\/?opt>/,"")
!(Net::HTTP.new(HOST).post(URL,xml,"X-TrackerToken" => token, "Content-type" => "application/xml").code =~ /^2\d+$/).nil?
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment