Need help with pretty-hot-ranking-algorithm?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

yoshuawuyts
204 Stars 20 Forks MIT License 3 Commits 0 Opened issues

Description

Algorithm that measures how relevant a given data set is, kinda like Reddit

Services available

!
?

Need anything else?

Contributors list

# 16,484
Rust
Mongoos...
Express
Koa
3 commits

pretty-hot-ranking-algorithm stability

npm version build status downloads js-standard-style

Algorithm that measures how relevant a given data set is, kinda like Reddit

Doesn't do any jitter stuff and can probably be gamed if you try hard enough, but it should be useful enough if you want to wire up community-driven news site that always has fresh, relevant content for people to discover.

Usage

var rank = require('pretty-hot-ranking-algorithm')

var start = new Date(20, 2, 2006) var upvotes = 15 var downvotes = 4 var date = new Date()

var itemRank = rank(upvotes, downvotes, date, start)

API

itemRank = rank(upvotes, downvotes, date, start)

Generate an item rank based off upvotes, downvotes and the current date. The last argument is the time of the first post, generally this should be close to when the server first goes live.

See Also

License

MIT

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.