Spaces:
Running
Running
Download lib/hot-score.ts from Jacksuyu/demandsolution-codex: direct link, hf CLI and curl.
- Browser
- Download file 197 Bytes
-
https://huggingface.co/spaces/Jacksuyu/demandsolution-codex/resolve/main/lib/hot-score.ts
- Command line
-
hf download hf://spaces/Jacksuyu/demandsolution-codex/lib/hot-score.ts
-
curl -L -o hot-score.ts https://huggingface.co/spaces/Jacksuyu/demandsolution-codex/resolve/main/lib/hot-score.ts
197 Bytes
| export function scoreHot(upvotes: number, createdAt: Date): number { | |
| const ageHours = Math.max(1, (Date.now() - createdAt.getTime()) / 3600000); | |
| return upvotes / Math.pow(ageHours + 2, 0.8); | |
| } | |