Hacker News new | past | comments | ask | show | jobs | submit login
Hacker News clone for CouchDB (hckr.it)
67 points by sktrdie on May 24, 2012 | hide | past | favorite | 17 comments



I wrote this because I thought it would be cool to let people host their own HN sites with very little overhead. CouchApps make it so easy to deploy your own site, simply push the code to a CouchDB. Also I learned quite a lot from building this. More info can be found here: https://github.com/lmatteis/hckr.it

There's still lots of work to be done, so don't hesitate to contribute :)


Wow that is neat.

I saw you use couchapp, installed with npm. Have you tried kanso http://kan.so ?

There is also erica, a similar couchapp deploying script written in Erlang. That one comes with an ACE on-line code editor (so you can edit your couchapp as it runs).


Are stories on the frontpage ranked solely by points or do they fall off over time? I couldn't find any code like this. I was curious how you'd implement time-ranking using couchdb views, which can't emit different values as time goes on in a simple way.


They fall over time. The algorithm simply needs the date the item was created at and the amount of points.

The difference is that instead of doing the calculation from the "time since submission" (which changes over time and, as you say, won't work with Couch's views which can't emit values as time goes on) it does the calculation using the "created_at" property. In essence the outcome is the same.

Here's the algorithm I use which needs some better documentation :) https://github.com/lmatteis/hckr.it/blob/master/common/util....


It's the reddit's algo, isn't it?


I believe reddit's gives newer posts more points, rather than taking away points from older posts.

I might be wrong, though. It's been a while since I've looked at that part of the code.


Mmm... not so sure. One of the nice features of reddit's algo is that it doesn't require to evaluate the score based on the current time, as this one. http://amix.dk/blog/post/19588

There are also a few similarities like max(abs(points+1),1), log base 10...


That's pretty much how it works (as explained by reddit co-founder Steve Huffman in Udacity 253 course - sorry I forget exactly which video he says it).


The HN algorithm is outlined here: http://amix.dk/blog/post/19574


Was this inspired by antirez's lamernews? http://lamernews.com/

It's funny to see two different HN clones, both of them coming from Italy :)


I've actually never seen this. Looks very nice. The idea of mine was also to keep the same API (the HTML and the links schema) of HN, to enable re-use of already built crawlers and add-ons.

Also, this seems to depend on Ruby other than Redis. Which means you probably need to buy a VPS or some cloud hosting and set it all up with Redis and Ruby and other stuff. Lots of overhead if you ask me.

While with hckr.it, you simply push it to a Couch and you're done.


I think that antirez just wanted to make a tech demo, yours is more production oriented ;)

Buona fortuna!


Very cool - sounds like it is amazingly easy to deploy too. And inexpensive: http://www.iriscouch.com/


Does this have a way to counter spam votes posted from many different accounts?


I guess I could keep track of the user's IP address? How does HN do this?


Wow! That's pretty cool.


This is great. Except you forgot to return "Unknown or expired link." every other request




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: