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