mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-11 07:40:26 +08:00
fix(route/twitter/web-api): empty rslt not skipped (#11482)
Signed-off-by: Rongrong <i@rong.moe> Signed-off-by: Rongrong <i@rong.moe>
This commit is contained in:
@@ -115,24 +115,28 @@ function gatherLegacyFromData(entries, filter = 'tweet-') {
|
||||
const tweets = [];
|
||||
entries.forEach((entry) => {
|
||||
if (entry.entryId && entry.entryId.includes(filter)) {
|
||||
const tweet = entry.content.itemContent.tweet_results.result;
|
||||
const retweet = tweet.legacy.retweeted_status_result?.result;
|
||||
for (const t of [tweet, retweet]) {
|
||||
if (!t?.legacy) {
|
||||
continue;
|
||||
const tweet = entry.content.itemContent.tweet_results?.result;
|
||||
if (tweet) {
|
||||
const retweet = tweet.legacy?.retweeted_status_result?.result;
|
||||
for (const t of [tweet, retweet]) {
|
||||
if (!t?.legacy) {
|
||||
continue;
|
||||
}
|
||||
t.legacy.user = t.core.user_results.result.legacy;
|
||||
const quote = t.quoted_status_result?.result;
|
||||
if (quote) {
|
||||
t.legacy.quoted_status = quote.legacy;
|
||||
t.legacy.quoted_status.user = quote.core.user_results.result.legacy;
|
||||
}
|
||||
}
|
||||
t.legacy.user = t.core.user_results.result.legacy;
|
||||
const quote = t.quoted_status_result?.result;
|
||||
if (quote) {
|
||||
t.legacy.quoted_status = quote.legacy;
|
||||
t.legacy.quoted_status.user = quote.core.user_results.result.legacy;
|
||||
const legacy = tweet.legacy;
|
||||
if (legacy) {
|
||||
if (retweet) {
|
||||
legacy.retweeted_status = retweet.legacy;
|
||||
}
|
||||
tweets.push(legacy);
|
||||
}
|
||||
}
|
||||
const legacy = tweet.legacy;
|
||||
if (retweet) {
|
||||
legacy.retweeted_status = retweet.legacy;
|
||||
}
|
||||
tweets.push(legacy);
|
||||
}
|
||||
});
|
||||
return tweets;
|
||||
|
||||
Reference in New Issue
Block a user