Skip to content

Instantly share code, notes, and snippets.

@deplorableword
Created January 31, 2011 12:22
Show Gist options
  • Save deplorableword/803956 to your computer and use it in GitHub Desktop.
Save deplorableword/803956 to your computer and use it in GitHub Desktop.
sudo gem install ticketmaster, sudo gem install ticketmaster-lighthouse. usage: ruby lighthoust-export.rb accoutname username password projectid
require 'rubygems'
require 'ticketmaster'
require 'ticketmaster-lighthouse'
Lighthouse.account = ARGV[0]
Lighthouse.authenticate(ARGV[1],ARGV[2])
all_tickets = Lighthouse::Ticket.find(:all, :params => { :project_id => ARGV[3] })
begin
File.delete("export.html")
rescue
end
export = File.new("export.html", "w+")
all_tickets.each do |ticket|
export.puts('<h1> (#'+ticket.id.to_s+') '+ticket.title+'</h1>')
if (ticket.original_body != nil)
export.puts('<p>'+ticket.original_body+'</p>')
end
export.puts('<hr />')
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment