mirror of
https://github.com/vale981/Vulcan
synced 2025-03-09 12:16:37 -04: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
|
// now multiply by 'age' exponentiated
|
||||||
// FIXME: timezones <-- set by server or is getTime() ok?
|
// 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
|
// HN algorithm
|
||||||
var newScore = baseScore / Math.pow(ageInHours + 2, 1.3);
|
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
|
// Note: before the first time updateScore runs on a new item, its score will be at 0
|
||||||
var scoreDiff = Math.abs(object.score - newScore);
|
var scoreDiff = Math.abs(object.score - newScore);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue