mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-13 00:35:57 +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,8 +115,9 @@ function gatherLegacyFromData(entries, filter = 'tweet-') {
|
|||||||
const tweets = [];
|
const tweets = [];
|
||||||
entries.forEach((entry) => {
|
entries.forEach((entry) => {
|
||||||
if (entry.entryId && entry.entryId.includes(filter)) {
|
if (entry.entryId && entry.entryId.includes(filter)) {
|
||||||
const tweet = entry.content.itemContent.tweet_results.result;
|
const tweet = entry.content.itemContent.tweet_results?.result;
|
||||||
const retweet = tweet.legacy.retweeted_status_result?.result;
|
if (tweet) {
|
||||||
|
const retweet = tweet.legacy?.retweeted_status_result?.result;
|
||||||
for (const t of [tweet, retweet]) {
|
for (const t of [tweet, retweet]) {
|
||||||
if (!t?.legacy) {
|
if (!t?.legacy) {
|
||||||
continue;
|
continue;
|
||||||
@@ -129,11 +130,14 @@ function gatherLegacyFromData(entries, filter = 'tweet-') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
const legacy = tweet.legacy;
|
const legacy = tweet.legacy;
|
||||||
|
if (legacy) {
|
||||||
if (retweet) {
|
if (retweet) {
|
||||||
legacy.retweeted_status = retweet.legacy;
|
legacy.retweeted_status = retweet.legacy;
|
||||||
}
|
}
|
||||||
tweets.push(legacy);
|
tweets.push(legacy);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
return tweets;
|
return tweets;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user