Arc Forumnew | comments | leaders | submitlogin
1 point by wheels 5694 days ago | link | parent

Pasting in the mail I sent to Paul yesterday. Not sure if it'll make it into the official releases, so I thought I'd post it here in case others find it useful:

It had been bugging me for a while that news.yc doesn't produce a proper RSS feed. The notable problems are:

- Doesn't include a published time, so articles aren't sorted properly

- Items that fall off the front-page and then come back are duplicated in the feed

- Sort order is wrong since it should be most recent articles first

So, I patch the news.yc to generate a proper feed. The diff is attached. My lisp-fu is more than a little rusty, so there may be some non-lisp-programmer brain-damage in there.

Basics are:

- Implemented a unix time to UTC converter to convert the timestamps to RSS-able UTC timestamps. - Add pubDate and guid tags to each post.

- Add a new field for stories that indicates if they've every been part of the RSS feed and write that to their disk records.

- If they have, and are in the top ntopstories + 10, continue to include them in the feed (this should prevent the dropping out and coming back).

Things that are probably wrong:

- I wasn't sure what the significance of * at the end of variables was. Global scope?

- I added a (gen-topstories) to the beginning of the RSS generator, which I presume is wrong for performance reasons, but was needed to make the right entries come back; wasn't sure what the correct thing to do there was.