forked from github.com/GenderDysphoria.fyi
Pulled in the twitter content backup functionality from curvyandtrans.com
Sadly, lost the images from one of Emmy_Zje's deleted tweets.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
const { chunk, uniq, difference } = require('lodash');
|
||||
const { chunk, uniq, uniqBy, difference } = require('lodash');
|
||||
const fs = require('fs-extra');
|
||||
const { resolve } = require('./resolve');
|
||||
const log = require('fancy-log');
|
||||
@@ -65,7 +65,7 @@ module.exports = exports = async function tweets (pages) {
|
||||
|
||||
/* Apply Tweets to Pages **************************************************/
|
||||
|
||||
const twitterMedia = [];
|
||||
var twitterMedia = [];
|
||||
|
||||
function attachTweet (dict, tweetid) {
|
||||
if (!hasOwn(twitterCache, tweetid) && twitterBackup[tweetid]) {
|
||||
@@ -91,6 +91,8 @@ module.exports = exports = async function tweets (pages) {
|
||||
}, {});
|
||||
}
|
||||
|
||||
twitterMedia = uniqBy(twitterMedia, 'output');
|
||||
|
||||
await Promise.all([
|
||||
fs.writeFile(resolve('twitter-media.json'), JSON.stringify(twitterMedia, null, 2)),
|
||||
fs.writeFile(resolve('twitter-cache.json'), JSON.stringify(twitterCache, null, 2)),
|
||||
|
||||
Reference in New Issue
Block a user