~sqwishy/froghat.ca

5b39d39163fa040f4cd4523e86957fb9f68171cb — sqwishy 9 months ago 8a7d74c
provide explicit updated date in feed generation

i think the feed entries' updated timestamp fall back to when the feed
was generated, so each time the list of feeds is updated, the entries'
updated property is also updated

idk it seems weird, just set it to the published date if it has no
updated date so it doesn't keep moving around
1 files changed, 8 insertions(+), 1 deletions(-)

M fucko/boingo.py
M fucko/boingo.py => fucko/boingo.py +8 -1
@@ 479,17 479,24 @@ def feedme(atom: str, rss: str, pretty: bool, inputs):

    inputs = (unpickle(open(f, "rb")) for f in inputs)
    pairs = ((p, next(inputs)) for p in inputs)
    # # sort by date descending I guess? I'm not sure it matters
    # pairs = sorted(pairs, key=lambda postpair: -postpair[0]['date'])
    for post, body in pairs:
        self = f'{site_url}/{post["rstpath"].parent}'
        author = post.get("author") or cfg.site.author

        fe = fg.add_entry()
        fe = fg.add_entry(order='append')
        fe.id(self)
        fe.link(href=self)
        fe.title(post["title"])
        fe.published(post["date"])
        if "updated" in post:
            fe.updated(post["updated"])
        else:
            # `updated(None)` (the default value) uses the current timestamp
            # that the feed is being generated at ??? so it looks like posts are always
            # updated??? idk why
            fe.updated(post["date"])
        if author:
            fe.author(name=author)  # TODO support email?
        else: