aboutsummaryrefslogtreecommitdiffstats
path: root/local/utility.py
diff options
context:
space:
mode:
authorkongr45gpen <electrovesta@gmail.com>2016-01-21 16:18:46 +0200
committerkongr45gpen <electrovesta@gmail.com>2016-01-21 16:18:46 +0200
commit5a5e25fdfb6fd7482b52d0232fae974c5e483749 (patch)
treeba6dfd30bd8e890cf647c0fc2cfd0d20bb3191aa /local/utility.py
parentd54c3d33b79094938393e6e995c64f0eda492f9c (diff)
downloadsupybot_github-5a5e25fdfb6fd7482b52d0232fae974c5e483749.tar.gz
supybot_github-5a5e25fdfb6fd7482b52d0232fae974c5e483749.tar.bz2
supybot_github-5a5e25fdfb6fd7482b52d0232fae974c5e483749.zip
Make travis links purple
Closes #7
Diffstat (limited to 'local/utility.py')
-rw-r--r--local/utility.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/local/utility.py b/local/utility.py
index 9a3520a..3487b06 100644
--- a/local/utility.py
+++ b/local/utility.py
@@ -76,7 +76,7 @@ def colorAction(action):
def getShortURL(longurl):
""" Returns a short URL generated by git.io"""
- if configValue("shortURL") is False:
+ if configValue("shortURL") is False or not getShortURL.github.match(longurl):
url = longurl
else:
data = 'url=%s' % (longurl)
@@ -84,6 +84,7 @@ def getShortURL(longurl):
response = urllib2.urlopen(req)
url = response.info().getheader('Location')
return ircutils.mircColor(url, "purple")
+getShortURL.github = re.compile('^([a-z]*\:\/\/)?([^\/]+.)?github.com')
def saveMessages(msgs):
""" Saves the last messages so that the plugin can be easily tested """

© 2014-2024 Faster IT GmbH | imprint | privacy policy