Permalink
Browse files

Code cleanup for the URLs plugin.

Signed-off-by: Yorick Peterse <yorick@isset.nl>
  • Loading branch information...
1 parent f1d853f commit 464d46eb03e5a66bf270c4188531e29114da9575 Yorick Peterse committed Apr 6, 2012
Showing with 4 additions and 3 deletions.
  1. +4 −3 plugins/urls.py
View
@@ -1,7 +1,8 @@
import re
from util import hook, urlnorm, http
-ignore = ['buttbot']
+ignore = ['buttbot']
+ignore_hosts = ['youtube.', 'twitter.']
@hook.regex(r'([a-zA-Z]+://|www\.)[^ ]+')
def show_title(match, nick='', chan='', say=None):
@@ -15,7 +16,7 @@ def show_title(match, nick='', chan='', say=None):
# Only ignore URLs of which "twitter" or "youtube" is part of the
# domain and not just part some some URI segment.
- if 'youtube.' not in url and 'twitter.' not in url:
+ if url not in ignore_hosts:
# Don't show the title if there isn't one
if title:
titleList = []
@@ -27,7 +28,7 @@ def show_title(match, nick='', chan='', say=None):
if titleList:
titleList = ''.join(titleList)
- message = 'URL title: %s' % (''.join(titleList))
+ message = 'URL title: %s' % (titleList)
if len(url) >= 80:
short_url = http.get(

0 comments on commit 464d46e

Please sign in to comment.