Skip to content

Instantly share code, notes, and snippets.

@willbailey
Created June 1, 2009 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save willbailey/121431 to your computer and use it in GitHub Desktop.
Save willbailey/121431 to your computer and use it in GitHub Desktop.
#! /usr/bin/env ruby
require 'rubygems'
require 'hpricot'
username = "<username>"
password = "<password>"
tix = Hpricot(IO.popen("curl https://trac.zenbe.com/report/7 --basic -u #{username}:#{password} -k -s"))
(tix/"table.listing.tickets"/"tbody"/"tr").each { |row|
ticket = (row/"td.ticket"/"a").first.inner_html
summary = (row/"td.summary"/"a").first.inner_html
date = (row/"td.date").first.inner_html.strip
priority = (row/"td.priority").first.inner_html.strip
puts "#{ticket} -- #{summary} -- #{date} -- #{priority}".gsub("\n","")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment