From c54b977e54177c61905415334c4aa2c8101b10d3 Mon Sep 17 00:00:00 2001 From: Jocelyn Badgley Date: Sun, 26 Jan 2025 13:26:15 -0800 Subject: [PATCH] Disable tweet fetching --- build/page-tweets.js | 6 ++++-- build/twitter-client.js | 8 +++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/build/page-tweets.js b/build/page-tweets.js index 7608af6..c8e832a 100644 --- a/build/page-tweets.js +++ b/build/page-tweets.js @@ -55,8 +55,9 @@ module.exports = exports = async function tweets (pages) { /* Load Missing Tweets **************************************************/ while (tweetsNeeded.length) { - log('Fetching tweets: ' + tweetsNeeded.join(', ')); - const arriving = await Promise.all(chunk(tweetsNeeded, 99).map(twitter)); + // log('Fetching tweets: ' + tweetsNeeded.join(', ')); + // const arriving = await Promise.all(chunk(tweetsNeeded, 99).map(twitter)); + const arriving = []; const tweetsRequested = tweetsNeeded; tweetsNeeded = []; const loaded = []; @@ -71,6 +72,7 @@ module.exports = exports = async function tweets (pages) { const absent = difference(tweetsRequested, loaded); for (const id of absent) { + if (!id) continue; if (!hasOwn(twitterBackup, id)) { log.error('Could not find tweet ' + id); continue; diff --git a/build/twitter-client.js b/build/twitter-client.js index f09795a..5499ea2 100644 --- a/build/twitter-client.js +++ b/build/twitter-client.js @@ -41,11 +41,12 @@ class TwitterClient { tweetids = uniq(tweetids.map(parseTweetId)); - let tweetsNeeded = this._missing(tweetids); + let tweetsNeeded = this._missing(tweetids).filter(Boolean); while (tweetsNeeded.length) { - log('Fetching tweets: ' + tweetsNeeded.join(', ')); - const arriving = await Promise.all(chunk(tweetsNeeded, 99).map(this._lookup)); + // log('Fetching tweets: ' + tweetsNeeded.join(', ')); + // const arriving = await Promise.all(chunk(tweetsNeeded, 99).map(this._lookup)); + const arriving = []; const tweetsRequested = tweetsNeeded; tweetsNeeded = []; const loaded = []; @@ -61,6 +62,7 @@ class TwitterClient { const absent = difference(tweetsRequested, loaded); for (const id of absent) { + if (!id) continue; if (!hasOwn(this._backupData, id)) { log.error('Could not find tweet ' + id); continue;