extract product
This commit is contained in:
parent
8a7dd58d5a
commit
0c4d366c08
1 changed files with 4 additions and 1 deletions
|
@ -4,7 +4,10 @@ require 'nokogiri'
|
|||
Client.register_command("bug") { |args|
|
||||
if args[0] =~ /^[0-9]+$/ then
|
||||
doc = Nokogiri::HTML(Net::HTTP.get(URI(Config[:commands][:bug][:url] + args[0])))
|
||||
[Config[:commands][:bug][:url] + args[0], doc.title().delete!('\n'), doc.xpath('//span[@id="static_bug_status"]').inner_text.split].join(' ')
|
||||
[Config[:commands][:bug][:url] + args[0], doc.title().delete!('\n'),
|
||||
doc.xpath('//span[@id="static_bug_status"]').inner_text.split,
|
||||
doc.xpath('//td[@id="field_container_product"]').inner_text,
|
||||
].join(' ')
|
||||
else
|
||||
"invalid bug url"
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue