pull down to refresh

I was thinking the script would just fetch all comments on the post and reduce to calculate the leaderboard, instead of having to specify a nym manually
100 sats \ 1 reply \ @ek OP 4h
I wanted to do that, but I realized the API makes this hard because of all the nested replies. I would have to assume some upper limit of how deeply nested replies are and then it might kill the server unnecessarily increase server load if everybody runs that script all the time.
So I decided to just use this simple SQL query for the leaderboard:
SELECT users.name, count("Item".id) AS nreplies
FROM "Item"
JOIN users ON users.id = "Item"."userId"
WHERE "rootId" = 948515 AND freebie = 'f'
GROUP BY users.name
ORDER BY nreplies DESC;
and give everyone a way to verify their own number by fetching all their own comments from last week (the items you can see in someone's profile) and then only counting the replies to this post.
reply
Nice query!
reply