diff --git a/plugins/commands/gentoo-bugs.rb b/plugins/commands/gentoo-bugs.rb index ee5d9ab..2d27bbf 100644 --- a/plugins/commands/gentoo-bugs.rb +++ b/plugins/commands/gentoo-bugs.rb @@ -2,6 +2,11 @@ require 'net/http' require 'nokogiri' Client.register_command("bug") { |args| - Config[:commands][:bug][:url] + args[0] + Nokogiri::HTML(Net::HTTP.get(URI(Config[:commands][:bug][:url] + args[0]))).title().delete!('\n') + 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') + else + "invalid bug url" + end }