Disable tweet fetching

This commit is contained in:
Jocelyn Badgley 2025-01-26 13:26:15 -08:00
parent 91caaa2411
commit c54b977e54
No known key found for this signature in database
GPG Key ID: 909059F0FFF842D8
2 changed files with 9 additions and 5 deletions

View File

@ -55,8 +55,9 @@ module.exports = exports = async function tweets (pages) {
/* Load Missing Tweets **************************************************/ /* Load Missing Tweets **************************************************/
while (tweetsNeeded.length) { while (tweetsNeeded.length) {
log('Fetching tweets: ' + tweetsNeeded.join(', ')); // log('Fetching tweets: ' + tweetsNeeded.join(', '));
const arriving = await Promise.all(chunk(tweetsNeeded, 99).map(twitter)); // const arriving = await Promise.all(chunk(tweetsNeeded, 99).map(twitter));
const arriving = [];
const tweetsRequested = tweetsNeeded; const tweetsRequested = tweetsNeeded;
tweetsNeeded = []; tweetsNeeded = [];
const loaded = []; const loaded = [];
@ -71,6 +72,7 @@ module.exports = exports = async function tweets (pages) {
const absent = difference(tweetsRequested, loaded); const absent = difference(tweetsRequested, loaded);
for (const id of absent) { for (const id of absent) {
if (!id) continue;
if (!hasOwn(twitterBackup, id)) { if (!hasOwn(twitterBackup, id)) {
log.error('Could not find tweet ' + id); log.error('Could not find tweet ' + id);
continue; continue;

View File

@ -41,11 +41,12 @@ class TwitterClient {
tweetids = uniq(tweetids.map(parseTweetId)); tweetids = uniq(tweetids.map(parseTweetId));
let tweetsNeeded = this._missing(tweetids); let tweetsNeeded = this._missing(tweetids).filter(Boolean);
while (tweetsNeeded.length) { while (tweetsNeeded.length) {
log('Fetching tweets: ' + tweetsNeeded.join(', ')); // log('Fetching tweets: ' + tweetsNeeded.join(', '));
const arriving = await Promise.all(chunk(tweetsNeeded, 99).map(this._lookup)); // const arriving = await Promise.all(chunk(tweetsNeeded, 99).map(this._lookup));
const arriving = [];
const tweetsRequested = tweetsNeeded; const tweetsRequested = tweetsNeeded;
tweetsNeeded = []; tweetsNeeded = [];
const loaded = []; const loaded = [];
@ -61,6 +62,7 @@ class TwitterClient {
const absent = difference(tweetsRequested, loaded); const absent = difference(tweetsRequested, loaded);
for (const id of absent) { for (const id of absent) {
if (!id) continue;
if (!hasOwn(this._backupData, id)) { if (!hasOwn(this._backupData, id)) {
log.error('Could not find tweet ' + id); log.error('Could not find tweet ' + id);
continue; continue;