Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feed entry published date should have better defaults #113

Open
anarcat opened this issue Sep 10, 2017 · 0 comments
Open

feed entry published date should have better defaults #113

anarcat opened this issue Sep 10, 2017 · 0 comments

Comments

@anarcat
Copy link

anarcat commented Sep 10, 2017

There are two possible fallbacks for the feed date that are missing:

  • the entry's created date field
  • the feed itself's updated date field

in my code, I worked around this by doing this in a loop when processing entries:

        # add more defaults to entry dates:
        # 1. created_parsed of the item
        # 2. updated_parsed of the feed
        entry['updated_parsed'] = entry.get('updated_parsed', entry.get('created_parsed', data['feed'].get('updated_parsed', False)))  # noqa
        assert entry.get('updated_parsed') is not None

quite a mouthful... it seems to me the entry getter should at least add created as a fallback, but also use the feed's updated date as a fallback as well...

is there a better way to do this? or to monkeypatch around that issue in a cleaner way?

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant