aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcedricbonhomme <devnull@localhost>2010-06-09 14:36:25 +0200
committercedricbonhomme <devnull@localhost>2010-06-09 14:36:25 +0200
commitf25c7bd294f5a2cdc58896d04a6e8fb3f3004562 (patch)
tree2daab4e70f91edc339c74c656568fd07889271c0
parentTypo fix. (diff)
downloadnewspipe-f25c7bd294f5a2cdc58896d04a6e8fb3f3004562.tar.gz
newspipe-f25c7bd294f5a2cdc58896d04a6e8fb3f3004562.tar.bz2
newspipe-f25c7bd294f5a2cdc58896d04a6e8fb3f3004562.zip
Little bug fix when the link of the feed in the tag 'link' don't contains the domain.
-rwxr-xr-xutils.py3
-rwxr-xr-xvar/feed.lst1
2 files changed, 4 insertions, 0 deletions
diff --git a/utils.py b/utils.py
index ea04fb12..a23584e0 100755
--- a/utils.py
+++ b/utils.py
@@ -20,6 +20,7 @@ import string
import hashlib
import sqlite3
import operator
+import urlparse
import smtplib
from email.mime.text import MIMEText
@@ -209,6 +210,8 @@ def search_feed(url):
page = urllib2.urlopen(url)
soup = BeautifulSoup(page)
for feed_link in soup('link', type='application/atom+xml'):
+ if url not in feed_link['href']:
+ return urlparse.urljoin(url, feed_link['href'])
return feed_link['href']
return None
diff --git a/var/feed.lst b/var/feed.lst
index c850dafb..85650934 100755
--- a/var/feed.lst
+++ b/var/feed.lst
@@ -24,3 +24,4 @@ http://www.jeffersonswheel.org/?feed=rss2
http://www.laquadrature.net/en/rss.xml
http://static.fsf.org/fsforg/rss/blogs.xml
http://esr.ibiblio.org/?feed=rss2
+http://xkcd.com/atom.xml
bgstack15