(Hacker News is an awesome website where so many hackers and startup guys around the world show-off their work or share useful content on the interwebs. You should visit everyday.)

The Code

I arrange this bash script to run every 5 minutes with cronjob:

<code lang="sh" class="sh">
curl http://news.ycombinator.com | grep -o 'id=[0-9]\+' | sed 's/id=//' >> frontpage
sort frontpage | uniq > frontpage.tmp && mv frontpage.tmp frontpage

curl http://news.ycombinator.com/newest | grep -o 'id=[0-9]\+' | sed 's/id=//' >> newest
sort newest | uniq > newest.tmp && mv newest.tmp newest
</code>

Basically it fetches post ids from Hacker News front page and newest submissions page and then combines with the previously fetched ones and keeps them in separate files.

After running it for a while, number of lines in newest and frontpage files will tell us the results.

The Result

I ran this cronjob for 5 days. (Tue/Wed/Thu/Fri/Sun) Results are:

  • 3697 submissions, 554 distinct items on front page.
  • 15% of the submissions made it to the front page.

Although, there is a certain effect of title of the post you submitted on Hacker News, there is a huge chance factor. So there it is. The 15%.