Modernized some code.

This commit is contained in:
lukeroge 2012-03-28 11:24:20 +13:00
parent 6c31f313fd
commit b35868c0f1

View file

@ -8,7 +8,7 @@ def get_title(url):
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
if url[:7] != "http://" and url[:8] != "https://": if not url.startswith("http"):
url = "http://" + url url = "http://" + url
try: try:
# get the title # get the title