From be3e68f22190ed141e95cc33c9f5186b460b8a5a Mon Sep 17 00:00:00 2001 From: vulet Date: Fri, 23 Jul 2021 16:27:06 +0800 Subject: [PATCH] fix(nitter): missing threading. fix(proxy): add into registrar. --- commands/nitter.js | 5 +++++ registrar.js | 1 + 2 files changed, 6 insertions(+) diff --git a/commands/nitter.js b/commands/nitter.js index 5651b59..33d1252 100644 --- a/commands/nitter.js +++ b/commands/nitter.js @@ -27,6 +27,10 @@ const nitter = async (instance, url) => { path: replies[replies.length - 1].querySelector('a.tweet-link').href, text: replies[replies.length - 1].querySelector('.tweet-content').innerHTML, } : null, + isThread: !isReply && replies.length > 0 ? replies[replies.length - 1].classList.contains('unavailable') ? 'unavailable' : { + path: replies[replies.length - 1].querySelector('a.tweet-link').href, + text: replies[replies.length - 1].querySelector('.tweet-content').innerHTML, + } : null, stats: { replies: stats[0].textContent.trim(), retweets: stats[1].textContent.trim(), @@ -45,6 +49,7 @@ const card = (tweet, check, path) => `
${tweet.text.replace('\n', '
')}
` + (tweet.hasAttachments ? '
This tweet has attached media.
' : '') + (tweet.isReply ? tweet.isReply === 'unavailable' ? '
Replied Tweet is unavailable
' : `
Replied Tweet
${tweet.isReply.text.replace('\n', '
')}
` : '') + +(tweet.isThread ? tweet.isThread === 'unavailable' ? '
Previous Tweet is unavailable
' : `
Previous Tweet
${tweet.isThread.text.replace('\n', '
')}
` : '') + (tweet.quote ? `
Quoted Tweet
${tweet.quote.text.replace('\n', '
')}
` : ''); const getInstance = (domain, config) => diff --git a/registrar.js b/registrar.js index a4540d5..24aff32 100644 --- a/registrar.js +++ b/registrar.js @@ -27,6 +27,7 @@ global.matrix = { module.exports = { config: require('./config.js'), archive: require('./commands/archive.js'), + proxy: require('./commands/proxy.js'), invidious: require('./commands/invidious.js'), nitter: require('./commands/nitter.js'), beg: require('./commands/fediverse/beg.js'),