def feed2fields(file):
 import feedparser
 d = feedparser.parse(file)
 for entry in d.entries:
  date = (time.strftime(u'%Y-%m-%d %H:%M', entry.updated_parsed) if hasattr(entry, u'updated_parsed') else None)
  author = (entry.author if hasattr(entry, u'author') else None)
  tags = ([e[u'term'] for e in entry.tags] if hasattr(entry, u'tags') else None)
  slug = slugify(entry.title)
  kind = u'article'
  (yield (entry.title, entry.description, slug, date, author, [], tags, None, kind, u'html'))

def feed2fields ( file ) : import feedparser d = feedparser . parse ( file ) for entry in d . entries : date = ( time . strftime ( u'%Y-%m-%d %H:%M' , entry . updated_parsed ) if hasattr ( entry , u'updated_parsed' ) else None ) author = ( entry . author if hasattr ( entry , u'author' ) else None ) tags = ( [ e [ u'term' ] for e in entry . tags ] if hasattr ( entry , u'tags' ) else None ) slug = slugify ( entry . title ) kind = u'article' ( yield ( entry . title , entry . description , slug , date , author , [ ] , tags , None , kind , u'html' ) )
read a feed and yield pelican fields .