def parse(feedparser, args):
    """parse a feed using feedparser"""
    entries = []
    args = irc3.utils.Config(args)
    max_date = datetime.datetime.now() - datetime.timedelta(days=2)

    for filename in args['filenames']:
        try:
            with open(filename + '.updated') as fd:
                updated = fd.read().strip()
        except (OSError, IOError):
            updated = '0'

        feed = feedparser.parse(filename)
        for e in feed.entries:
            if e.updated <= updated:
                # skip already sent entries
                continue
            try:
                updated_parsed = e.updated_parsed
            except __HOLE__:
                continue
            if datetime.datetime(*updated_parsed[:7]) < max_date:
                # skip entries older than 2 days
                continue
            e['filename'] = filename
            e['feed'] = args
            entries.append((e.updated, e))
        if entries:
            entries = sorted(entries, key=itemgetter(0))
            with open(filename + '.updated', 'w') as fd:
                fd.write(str(entries[-1][0]))
    return entries
dataset/ETHPy150Open gawel/irc3/irc3/plugins/feeds.py/parse