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;