an atproto based link aggregator
at main 9 lines 354 B view raw
1/** 2 * Calculate hot score using HN-style algorithm 3 * score = votes / (age_hours + 2)^gravity 4 */ 5export function calculateHotScore(voteCount: number, createdAt: string, gravity = 1.5): number { 6 const ageMs = Date.now() - new Date(createdAt).getTime(); 7 const ageHours = ageMs / (1000 * 60 * 60); 8 return voteCount / Math.pow(ageHours + 2, gravity); 9}