mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-07-15 00:14:45 +02:00
[TwitterBridge] Filter out any promoted tweet (#3652)
* Filter out any advertise tweet * Make some filter work, fix bug that may happen with tweet id list. * clear phpcs warning, ignore line length warning
This commit is contained in:
parent
52b90e0873
commit
dbe37cc302
2 changed files with 60 additions and 37 deletions
|
@ -146,9 +146,14 @@ class TwitterClient
|
|||
}
|
||||
|
||||
if (isset($timeline->data->user)) {
|
||||
if (!isset($entry->content->itemContent->tweet_results->result->legacy)) {
|
||||
if (!isset($entry->content->itemContent->tweet_results->result)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (isset($entry->content->itemContent->promotedMetadata)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$tweets[] = $entry->content->itemContent->tweet_results->result;
|
||||
|
||||
$userIds[] = $entry->content->itemContent->tweet_results->result->core->user_results->result;
|
||||
|
@ -156,6 +161,12 @@ class TwitterClient
|
|||
if (!isset($entry->content->content->tweetResult->result->legacy)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Filter out any advertise tweet
|
||||
if (isset($entry->content->content->tweetPromotedMetadata)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$tweets[] = $entry->content->content->tweetResult->result;
|
||||
|
||||
$userIds[] = $entry->content->content->tweetResult->result->core->user_result->result;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue