Improvements, improvements…
This commit is contained in:
parent
8e7de643df
commit
725262c5c6
1 changed files with 6 additions and 1 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue