Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Yeah I’m really happy HN offers an API like this instead of locking things down like a bunch of other sites…

I used a function based on the age for staleness, it considers things stale after a minute or two initially and immutable after about two weeks old.

    // DefaultStaleIf marks stale at 60 seconds after creation, then frequently for the first few days after an item is
    // created, then quickly tapers after the first week to never again mark stale items more than a few weeks old.

    const DefaultStaleIf = "(:now-refreshed)>" +
 "(60.0*(log2(max(0.0,((:now-Time)/60.0))+1.0)+pow(((:now-Time)/(24.0*60.0*60.0)),3)))"
https://github.com/jasonthorsness/unlurker/blob/main/hn/core...


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: