From 638939edd6cd57487ecadd953f59ed5efcd638ce Mon Sep 17 00:00:00 2001 From: ekzyis Date: Mon, 18 Mar 2024 07:07:09 +0100 Subject: [PATCH] Only post the oldest HN item per run --- sn.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sn.go b/sn.go index d1ee6e7..604ca13 100644 --- a/sn.go +++ b/sn.go @@ -22,6 +22,8 @@ func CurateContentForStackerNews() (*[]Story, error) { SELECT id, MAX(created_at) AS created_at FROM hn_items WHERE rank = 1 AND id NOT IN (SELECT hn_id FROM sn_items) AND length(title) >= 5 GROUP BY id + ORDER BY time ASC + LIMIT 1 ) t JOIN hn_items ON t.id = hn_items.id AND t.created_at = hn_items.created_at; `); err != nil { err = fmt.Errorf("error querying hn_items: %w", err)