/** * Calculate hot score using HN-style algorithm * score = votes / (age_hours + 2)^gravity */ export function calculateHotScore(voteCount: number, createdAt: string, gravity = 1.5): number { const ageMs = Date.now() - new Date(createdAt).getTime(); const ageHours = ageMs / (1000 * 60 * 60); return voteCount / Math.pow(ageHours + 2, gravity); }