[RssNotify] Add some error handling

master
Sfan5 2014-04-30 19:17:54 +02:00
parent eeaa609e8e
commit bf69c00751
1 changed files with 5 additions and 1 deletions

View File

@ -84,7 +84,11 @@ def rsscheck(phenny, input):
params = urllib.urlencode({'url' : feed_entry.link})
# Side note: git.io only works with *.github.com links
u = urllib.urlopen("http://git.io/create", params)
commit_link = "http://git.io/" + u.read()
l = u.read()
if len(l.strip()) == 6:
commit_link = "http://git.io/" + u.read()
else:
commit_link = feed_entry.link
else:
commit_link = feed_entry.link
else: