From 5a5b634e972840c250a7fb84878114daf151c7e1 Mon Sep 17 00:00:00 2001 From: Sylvan Zheng Date: Tue, 7 Feb 2023 21:03:23 +0000 Subject: [PATCH] random recent fetch --- server/lib/fetch.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/lib/fetch.js b/server/lib/fetch.js index 136c3c5..fadb090 100644 --- a/server/lib/fetch.js +++ b/server/lib/fetch.js @@ -43,13 +43,14 @@ module.exports = async function (username, mock_ideo) { // todo: handle retweets // todo: make sure the null filter is actually working - // todo: time box results = await db.any( ` with relevant_tweets as ( select * from tweets where author_id in ( select id from elites where sign(ideo) = $1 ) and referenced_tweet_type is null + order by created_at desc + limit 256 ) select relevant_tweets.id as id, @@ -79,7 +80,7 @@ module.exports = async function (username, mock_ideo) { left join links on relevant_tweets.link_preview_url = links.turl left join media on relevant_tweets.media_id_1 = media.id left join authors on relevant_tweets.author_id = authors.id - order by created_at desc + order by random() limit 64; `, -ideo_sign