Update plugins/urlparse.py
This commit is contained in:
parent
f025df92b6
commit
51a31caf99
1 changed files with 2 additions and 3 deletions
|
@ -4,8 +4,7 @@ import re
|
||||||
titler = re.compile(r'(?si)<title>(.+?)</title>')
|
titler = re.compile(r'(?si)<title>(.+?)</title>')
|
||||||
|
|
||||||
|
|
||||||
def parse(url):
|
def gettitle(url):
|
||||||
""" an improved version of our parsing code - now regex powered """
|
|
||||||
url = urlnorm.normalize(url.encode('utf-8'))
|
url = urlnorm.normalize(url.encode('utf-8'))
|
||||||
url = url.decode('utf-8')
|
url = url.decode('utf-8')
|
||||||
# add http if its missing
|
# add http if its missing
|
||||||
|
@ -34,4 +33,4 @@ def parse(url):
|
||||||
@hook.command
|
@hook.command
|
||||||
def title(inp):
|
def title(inp):
|
||||||
".title <url> -- gets the title of a web page"
|
".title <url> -- gets the title of a web page"
|
||||||
return parse(inp)
|
return gettitle(inp)
|
||||||
|
|
Reference in a new issue