Skip to content

Instantly share code, notes, and snippets.

@atoulme
Created April 11, 2011 18:14
Show Gist options
  • Save atoulme/913970 to your computer and use it in GitHub Desktop.
Save atoulme/913970 to your computer and use it in GitHub Desktop.
A simple script to scrap a set of jira issues from Jira. You should always use the "printable" url of the filter you pass.
require 'uri'
require 'net/http'
require 'rubygems'
require 'hpricot'
def extract_updates(url)
html = Net::HTTP.get(URI.parse(url))
doc = Hpricot(html)
table = doc.search("//*[@id='issuetable']")
table.search("//*[@class='nav duedate']").remove
table.search("//*[@class='nav progress']").remove
table.search("//*[@class='nav created']").remove
table.search("//*[@class='nav issuekey']").remove
table.search("//*[@class='colHeaderLink headerrow-issuekey']").remove
table.search("//*[@class='colHeaderLink headerrow-created']").remove
table.search("//*[@class='colHeaderLink headerrow-duedate']").remove
table.search("//*[@class='colHeaderLink headerrow-progress']").remove
puts table
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment