Permalink
Browse files

Handle FeedParser's peculiar handing of RSS 1.0 feeds

  • Loading branch information...
1 parent b31973d commit cf8144b85e1c3f8e7213c5a0ae0a027bd5a1abf1 Sam Ruby committed Aug 16, 2006
Showing with 4 additions and 3 deletions.
  1. +3 −2 planet/reconstitute.py
  2. +1 −1 spider.py
@@ -86,10 +86,11 @@ def links(xentry, entry):
if not entry.has_key('links'): return
xdoc = xentry.ownerDocument
for link in entry.links:
+ if not 'href' in link.keys(): continue
xlink = xdoc.createElement('link')
- xlink.setAttribute('type', link.type)
+ xlink.setAttribute('type', link.get('type',None))
xlink.setAttribute('href', link.href)
- xlink.setAttribute('rel', link.rel)
+ xlink.setAttribute('rel', link.get('rel',None))
xentry.appendChild(xlink)
def date(xentry, name, parsed):
View
@@ -10,7 +10,7 @@
if len(sys.argv) == 2:
# spider all feeds
spider.spiderPlanet(sys.argv[1])
- elif len(sys.argv) > 2 and os.path.isdir(sys.argv[1]):
+ elif len(sys.argv) > 2:
# spider selected feeds
config.load(sys.argv[1])
for feed in sys.argv[2:]:

0 comments on commit cf8144b

Please sign in to comment.