summaryrefslogtreecommitdiff
path: root/data/rbot/plugins/url.rb
diff options
context:
space:
mode:
Diffstat (limited to 'data/rbot/plugins/url.rb')
-rw-r--r--data/rbot/plugins/url.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/data/rbot/plugins/url.rb b/data/rbot/plugins/url.rb
index a4e96359..78f89305 100644
--- a/data/rbot/plugins/url.rb
+++ b/data/rbot/plugins/url.rb
@@ -1,7 +1,7 @@
require 'net/http'
require 'uri'
require 'cgi'
-
+
Url = Struct.new("Url", :channel, :nick, :time, :url)
TITLE_RE = /<\s*?title\s*?>(.+?)<\s*?\/title\s*?>/im
@@ -38,7 +38,7 @@ class UrlPlugin < Plugin
url = URI.parse(uri_str)
return if url.scheme !~ /https?/
- puts "+ connecting to #{url.host}:#{url.port}"
+ puts "+ connecting to #{url.host}:#{url.port}"
http = @bot.httputil.get_proxy(url)
title = http.start do |http|
url.path = '/' if url.path == ''
@@ -55,7 +55,7 @@ class UrlPlugin < Plugin
if head['content-type'] =~ /^text\//
# content is 'text/*'
# retrieve the title from the page
- puts "+ getting #{url.path}"
+ puts "+ getting #{url.request_uri}"
response = http.request_get(url.request_uri)
return get_title_from_html(response.body)
else
@@ -67,7 +67,7 @@ class UrlPlugin < Plugin
when Net::HTTPClientError then
return "[Link Info] Error getting link (#{head.code} - #{head.message})"
when Net::HTTPServerError then
- return "[Link Info] Error getting link (#{head.code} - #{head.message})"
+ return "[Link Info] Error getting link (#{head.code} - #{head.message})"
end
end
rescue SocketError => e