

Hacker News clone for CouchDB - sktrdie
http://www.hckr.it/

======
sktrdie
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 :)

~~~
rdtsc
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).

------
cypherpunks01
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.

~~~
sktrdie
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....](https://github.com/lmatteis/hckr.it/blob/master/common/util.js#L2)

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

~~~
jkap
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.

~~~
ecesena
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...

------
danmaz74
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 :)

~~~
sktrdie
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.

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

Buona fortuna!

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

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

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

------
Greg12x
Wow! That's pretty cool.

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

