1
0
mirror of https://github.com/GenderDysphoria/GenderDysphoria.fyi.git synced 2025-11-25 20:42:40 +00:00

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:
Jocelyn Badgley (Twipped)
2021-08-25 09:45:21 -07:00
parent 3e570577b2
commit 9bfa5c4690
110 changed files with 6637 additions and 6029 deletions

View File

@@ -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)),