logoalt Hacker News

zX41ZdbWlast Wednesday at 11:40 AM3 repliesview on HN

I'm also collecting this data, and it allows rendering beautiful heatmaps like here: https://github.com/ClickHouse/ClickHouse/issues/59020

Try: ssh [email protected]

    SELECT id, max(score) AS s, max(descendants), argMax(title, update_time), arrayStringConcat(arrayMap(x -> format('\x1b[38;2;{0};{1};{2}m\xE2\x96\x88\x1b[0m', least(greatest(sqrt(x / 10) * 255, 0), 255)::UInt8::String, least(greatest(sqrt((x - 10) / 50) * 255, 0), 255)::UInt8::String, least(greatest(sqrt((x - 50) / 250) * 255, 0), 255)::UInt8::String), arrayDifference(arrayFill(x -> x != 0, maxResample(now() - INTERVAL 2 DAY, now(), 3600)(score, update_time))))) AS bar FROM hackernews_changes_items WHERE id IN (SELECT arrayJoin(ids) FROM (SELECT ids FROM hackernews_top WHERE type = 'top' ORDER BY update_time DESC LIMIT 1)) GROUP BY id ORDER BY s DESC LIMIT 10

Replies

clacker-o-maticlast Wednesday at 8:35 PM

i'm actually pretty sure I remember you from a few months back. didn't you post this then? if not i might have seen it in a comment or smthing

show 1 reply
clacker-o-maticlast Wednesday at 11:41 AM

Oooh thats awesome