TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: Algorithm arranging posts on HN?

2 点作者 bhavin超过 14 年前
I have noticed something on hn, that the posts on the main page gets arranged in a peculiar way. For example, a link posted 4 hours ago with less than 20 upvotes might be on the main page still, while another similarly aged link with twice as much upvotes might be on the second page.<p>I am wondering what algorithm is used in ordering them. Any idea?

4 条评论

RiderOfGiraffes超过 14 年前
There are several small tweaks that I've noticed. There's something about the length of a post, possibly something about the number of comments, and possibly others. There are also penalties for various things. Items without a link are ranked more lowly than those with a link, and some topics <i>du jour</i> have a penalty applied.<p>All in all, it's actively curated by PG, with small changes to keep the system in balance and running smoothly. Enquiring too closely is discouraged.<p>It's also plausible that this item will get deleted. After all, this is a site for hackers, not a site about Hacker News.
评论 #1967258 未加载
pelf超过 14 年前
<a href="http://news.ycombinator.com/item?id=1781013" rel="nofollow">http://news.ycombinator.com/item?id=1781013</a><p>quoting from PG's comment on that post:<p>(= gravity* 1.8 timebase* 120 front-threshold* 1 nourl-factor* .4 lightweight-factor* .17 gag-factor* .1)<p><pre><code> (def frontpage-rank (s (o scorefn realscore) (o gravity gravity*)) (* (/ (let base (- (scorefn s) 1) (if (&#62; base 0) (expt base .8) base)) (expt (/ (+ (item-age s) timebase*) 60) gravity)) (if (no (in s!type 'story 'poll)) .8 (blank s!url) nourl-factor* (mem 'bury s!keys) .001 (* (contro-factor s) (if (mem 'gag s!keys) gag-factor* (lightweight s) lightweight-factor* 1)))))</code></pre> -----<p>or simplifying a bit:<p>Score = (P-1) / (T+2)^G<p>where, P = points of an item (and -1 is to negate submitters vote) T = time since submission (in hours) G = Gravity, defaults to 1.8 in news.arc
gasull超过 14 年前
I noticed that this morning too:<p><a href="http://news.ycombinator.com/item?id=1966201" rel="nofollow">http://news.ycombinator.com/item?id=1966201</a>
kingsidharth超过 14 年前
One word: Yes. (Duh!)<p>FAQ: <a href="http://ycombinator.com/newsfaq.html" rel="nofollow">http://ycombinator.com/newsfaq.html</a>
评论 #1967246 未加载