From 725262c5c6aaacff72c81a4a47f6b56b2328d887 Mon Sep 17 00:00:00 2001 From: Robert Gerus Date: Tue, 25 Mar 2014 05:37:16 +0100 Subject: [PATCH] =?UTF-8?q?Improvements,=20improvements=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/commands/gentoo-bugs.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 }