summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2007-09-18 06:15:45 +0000
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2007-09-18 06:15:45 +0000
commit2da3a85740963a5dc4e9390115e13139f97511e2 (patch)
tree9b8df767c92c1ab1d406e1bad9d832b0b19df801 /data
parent6b57387fd524539e831fc434f626659d7d07d61c (diff)
HTML processing refactoring: HTML title extraction is now a String method
Diffstat (limited to 'data')
-rw-r--r--data/rbot/plugins/url.rb4
1 files changed, 1 insertions, 3 deletions
diff --git a/data/rbot/plugins/url.rb b/data/rbot/plugins/url.rb
index 6e609130..0809288f 100644
--- a/data/rbot/plugins/url.rb
+++ b/data/rbot/plugins/url.rb
@@ -9,7 +9,6 @@ class ::UrlLinkError < RuntimeError
end
class UrlPlugin < Plugin
- TITLE_RE = /<\s*?title\s*?>(.+?)<\s*?\/title\s*?>/im
LINK_INFO = "[Link Info]"
OUR_UNSAFE = Regexp.new("[^#{URI::PATTERN::UNRESERVED}#{URI::PATTERN::RESERVED}%# ]", false, 'N')
@@ -53,8 +52,7 @@ class UrlPlugin < Plugin
end
def get_title_from_html(pagedata)
- return unless TITLE_RE.match(pagedata)
- $1.ircify_html
+ return pagedata.ircify_html_title
end
def get_title_for_url(uri_str, opts = {})