mirror of
https://github.com/vale981/Vulcan
synced 2025-03-06 18:11:40 -05:00
fixed scoring typo
This commit is contained in:
parent
76e92fd3ef
commit
b3cdd86a5c
1 changed files with 3 additions and 1 deletions
|
@ -24,11 +24,13 @@ var updateScore = function (collection, id, forceUpdate) {
|
|||
|
||||
// now multiply by 'age' exponentiated
|
||||
// FIXME: timezones <-- set by server or is getTime() ok?
|
||||
var ageInHours = (new Date().getTime() - object.age) / (60 * 60 * 1000);
|
||||
var ageInHours = (new Date().getTime() - age) / (60 * 60 * 1000);
|
||||
|
||||
// HN algorithm
|
||||
var newScore = baseScore / Math.pow(ageInHours + 2, 1.3);
|
||||
|
||||
// console.log('newScore: '+newScore);
|
||||
|
||||
// Note: before the first time updateScore runs on a new item, its score will be at 0
|
||||
var scoreDiff = Math.abs(object.score - newScore);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue