Finally fix rssnotify
(and convert spaces to tabs)
This commit is contained in:
parent
cedd28c2f6
commit
dca95a9911
12
rssnotify.py
12
rssnotify.py
@ -3,7 +3,9 @@
|
||||
rssnotify.py - Phenny RssNotify Module
|
||||
Copyright 2013, sfan5
|
||||
"""
|
||||
import time, urllib.parse, re
|
||||
import time
|
||||
import re
|
||||
import web
|
||||
import feedparser # sudo pip install feedparser
|
||||
rssnotify = {}
|
||||
|
||||
@ -82,16 +84,18 @@ def rsscheck(phenny, input):
|
||||
continue
|
||||
if rssnotify["show_commit_link"]:
|
||||
if rssnotify["use_git.io"]:
|
||||
params = urllib.parse.urlencode({'url' : feed_entry.link})
|
||||
# Side note: git.io only works with *.github.com links
|
||||
u = urllib.urlopen("http://git.io/create", params)
|
||||
l = u.read()
|
||||
l, code = web.post("http://git.io/create", {'url': feed_entry.link})
|
||||
if code == 200:
|
||||
l = str(l, 'utf-8')
|
||||
if len(l.strip()) == 6:
|
||||
commit_link = "http://git.io/" + l
|
||||
else:
|
||||
commit_link = feed_entry.link
|
||||
else:
|
||||
commit_link = feed_entry.link
|
||||
else:
|
||||
commit_link = feed_entry.link
|
||||
else:
|
||||
commit_link = ""
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user