adapted to feedparser 5.1.3
This commit is contained in:
parent
3333d1fcaf
commit
f6e57378f2
13
atomstrom.py
13
atomstrom.py
@ -84,7 +84,7 @@ class Feedinfo(Base):
|
|||||||
self.encoding = parser.get('encoding')
|
self.encoding = parser.get('encoding')
|
||||||
self.bozo = parser.get('bozo')
|
self.bozo = parser.get('bozo')
|
||||||
self.lastfetched = datetime.now()
|
self.lastfetched = datetime.now()
|
||||||
if parser.get('status') == 200:
|
if parser.get('status') == 200 or parser.get('status') == 302:
|
||||||
self.lastsuccessful = datetime.now()
|
self.lastsuccessful = datetime.now()
|
||||||
|
|
||||||
|
|
||||||
@ -122,15 +122,18 @@ class Entry(Base):
|
|||||||
self.link = entry.get('link').encode('latin-1', 'replace')
|
self.link = entry.get('link').encode('latin-1', 'replace')
|
||||||
if entry.has_key('summary'):
|
if entry.has_key('summary'):
|
||||||
self.summary = entry.get('summary').encode('latin-1', 'replace')
|
self.summary = entry.get('summary').encode('latin-1', 'replace')
|
||||||
#if entry.has_key('content'):
|
if entry.has_key('content'):
|
||||||
# self.content = entry.get('content')
|
self.content = entry.get('content')[0].value.encode('latin-1', 'replace')
|
||||||
if entry.has_key('author'):
|
if entry.has_key('author'):
|
||||||
self.author = entry.get('author').encode('latin-1', 'replace')
|
self.author = entry.get('author').encode('latin-1', 'replace')
|
||||||
if entry.has_key('updated_parsed'):
|
if entry.has_key('updated_parsed'):
|
||||||
updated_parsed = entry.get('updated_parsed')
|
updated_parsed = entry.get('updated_parsed')
|
||||||
self.updated = datetime.fromtimestamp(mktime(updated_parsed))
|
self.updated = datetime.fromtimestamp(mktime(updated_parsed))
|
||||||
if entry.has_key('enclosures'):
|
if entry.has_key('enclosures') and len(entry.get('enclosures')) > 0:
|
||||||
self.enclosures = entry.get('enclosures').encode('latin-1', 'replace')
|
print 'enclosures';
|
||||||
|
pp=pprint.PrettyPrinter(depth=4)
|
||||||
|
pp.pprint(entry.get('enclosures'))
|
||||||
|
#self.enclosures = entry.get('enclosures').encode('latin-1', 'replace')
|
||||||
self.lastfetched = datetime.now()
|
self.lastfetched = datetime.now()
|
||||||
|
|
||||||
|
|
||||||
|
3399
feedparser.py
3399
feedparser.py
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user