Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spam in the Twitter feeds?! #3437

Closed
Aasemoon opened this issue Jun 16, 2023 · 30 comments
Closed

Spam in the Twitter feeds?! #3437

Aasemoon opened this issue Jun 16, 2023 · 30 comments
Labels
Bug-Report Confirmed bug report

Comments

@Aasemoon
Copy link

Aasemoon commented Jun 16, 2023

Describe the bug
I'm having a very strange issue for several weeks now. My Twitter feeds show items that don't belong, posts that were never posted by the specific account, and they seem an awful lot like advertisements, like spam. The oddest part is, when I try looking at the feed source directly, I don't see those posts in there. At first I thought it must have something to do with my reader, but after testing it out with a couple of other readers and seeing exactly the same spam, I figured it's the feed. Especially since my RSS-Bridge Twitter feeds are the only ones that do this. Other RSS-Bridge feeds don't have this issue either. It makes no sense but there it is.

To Reproduce
Subscribe to, for instance, @PaulStamets via the latest Twitter bridge.

Screenshots
Where the spam shows up:
image
And the account it actually belongs to, which I see when I click:
image

@Aasemoon Aasemoon added the Bug-Report Confirmed bug report label Jun 16, 2023
@martywd
Copy link

martywd commented Jun 16, 2023

Ditto. I've been seeing exactly the same thing that OP describes. Today for example, my twitterBridge 'ProtonSupport' subscription returned about a dozen posts totally unrelated to Proton Support's twitter account. The weird part was that one was was timestamped Oct 2022, the rest timestamped Dec 2022.
.

@dvikan
Copy link
Contributor

dvikan commented Jun 16, 2023

If this happens across rss-bridge instances it has to be coming from twitter itself.

@Aasemoon
Copy link
Author

Ok then clearly it's not just my setup, good to know at least that much!

@rogerdc
Copy link
Contributor

rogerdc commented Jun 16, 2023

Me five.

Got one. Here's the info from the "plain text" generation.

Spam article:

` [2] => Array
(
[uri] => https://twitter.com/GPrime85/status/1669569459022082048
[title] => 😍A look of styled-down elegance. The Relaxed Fit Denim Jacket, with its flattering boxy silhouette and vibrant color scheme, offers a welcome dose of ...
[timestamp] => 1686891352
[author] => George Alexopoulos (@GPrime85)
[content] =>

😍A look of styled-down elegance. The Relaxed Fit Denim Jacket, with its flattering boxy silhouette and vibrant color scheme, offers a welcome dose of comfort. 🛒Get it👉 holisale.co/E7866 pic.twitter.com/aAyNA2UvSO
[enclosures] => Array ( [0] => https://pbs.twimg.com/media/FytyuZSaMAApYnC.png?name=orig )
        [categories] => Array
            (
            )

        [uid] => 
        [username] => GPrime85
        [fullname] => George Alexopoulos
        [avatar] => https://pbs.twimg.com/profile_images/1589613544890408960/4L6wMTDw_normal.jpg
        [id] => 1669569459022082048
    )

`

Here's a regular item:

` [3] => Array
(
[uri] => https://twitter.com/GPrime85/status/1669448236745076739
[title] => Knocked it out during my lunch break 😁 My day job is finishing Ghost of the Badlands this summer.
[timestamp] => 1686862451
[author] => George Alexopoulos (@GPrime85)
[content] =>

Knocked it out during my lunch break 😁 My day job is finishing Ghost of the Badlands this summer.
[enclosures] => Array ( )
        [categories] => Array
            (
            )

        [uid] => 
        [username] => GPrime85
        [fullname] => George Alexopoulos
        [avatar] => https://pbs.twimg.com/profile_images/1589613544890408960/4L6wMTDw_normal.jpg
        [id] => 1669448236745076739
    )

`

Nothing is jumping out at me. Looking at a cURL request to the spam item URI, it sets some cookies and redirects, but when I put it in a web browser, I get 601 requests and it ends up redirecting me to the spam tweet of https://twitter.com/holisaleshop/status/1669569459022082048.

Unfortunately, I don't have time to parse through all the network traffic and application JS to figure out where it's getting redirected to find a way to distinguish real tweets from ads. Here's my HAR file.

twitter.ad.tweet.har.txt

@Aasemoon
Copy link
Author

I just feel the need to add here that the problem is growing fast. A few weeks ago I'd just see a couple of odd spam here and there. Between yesterday and today I've had several hundred spam posts showing up in my reader. This is starting to make it rather impossible to use the bridge.

@dvikan
Copy link
Contributor

dvikan commented Jun 18, 2023

can u produce an example on https://rss-bridge.org/bridge01/ ?

@Aasemoon
Copy link
Author

@dvikan I'm attempting to. I've just subscribed to a couple of feeds through there so now I'll have to wait and see.

@Aasemoon
Copy link
Author

Aasemoon commented Jun 19, 2023

@dvikan It appears that your instance doesn't get the spam posts!! Wonder why that is.

@aquova
Copy link

aquova commented Jun 20, 2023

I've been seeing these for a while in my feeds. It seems to happen in bursts. Sometimes I get the Tweets as expected, while other times I get a burst of ads. They don't seem to correspond to real Tweets either; it's not like the real Tweet is being replaced with an ad. I am looking now at a user that tweeted once today, but I received several of these ad posts. The timestamp on them also range throughout the month, even though they all arrived today, and I have been subscribed to them for some time.

@expenses
Copy link

I've also been getting this spam in my newsboat feeds. I think the ads are only shown occasionally though, I haven't gotten them to show up in rss-bridge itself yet.

@Aasemoon
Copy link
Author

Just FYI it seems to me that the spam tweets are promoted tweets. You may actually see the same tweets on the user's twitter profile if you browser without an adblock.

@stephenjamieson
Copy link

Getting a lot of them, the same ones too for multiple feeds.

@adegans
Copy link

adegans commented Jun 27, 2023

I've seen this too on one account I follow.
But the spam are not typical advert tweets - My thought was the account I followed was hacked had crap posted to it that immediately got deleted.
That way it will show up in peoples feeds for a few minutes (and get caught by the bridge) but when you go check it out it's already gone.

Some speculation though...

@Aasemoon
Copy link
Author

At the moment I'm receiving hundreds of spam posts [about 5-10 at a burst per account] and as of today I'm also suddenly getting error0s which was supposed to be a resolved problem. As it stands it's becoming impossible to continue using the bridge.
image

@virtadpt
Copy link

Maybe Twitter is causing trouble for those of us not going through "proper channels" to get API access these days?

@abodnar
Copy link

abodnar commented Jun 30, 2023

Well, this is likely the end of the Twitter Bridge anyways.

https://www.theverge.com/2023/6/30/23779764/twitter-blocks-unregistered-users-account-tweets

@dvikan
Copy link
Contributor

dvikan commented Jun 30, 2023

if anyone can produce a url i might be able to remove the spam. im unable to reproduce locally so i cant inspect the json

im refreshing these but unable to see anything:

https://rss-bridge.org/bridge01/?action=display&bridge=TwitterBridge&context=By+username&u=ProtonSupport&format=Html

https://rss-bridge.org/bridge01/?action=display&bridge=TwitterBridge&context=By+username&u=PaulStamets&format=Html

@stephenjamieson
Copy link

stephenjamieson commented Jun 30, 2023

It looks like the feed randomly removes these entries, my current feed does not have it. Here's an example url:

https://twitter.com/Kabajisan/status/1673695794011193344

see #3437 (comment)
You can see if you click on that it redirects to the ad. I don't think there's a way to detect it.

@adegans
Copy link

adegans commented Jun 30, 2023

I haven't looked at the code, but don't Twitter ads have a specific CSS class bit of code the script could detect and filter out?

@rogerdc
Copy link
Contributor

rogerdc commented Jun 30, 2023

@adegans One issue I saw is that the ads are embedded as regular tweets in the feed--with the same username. It's only through JS that you can get to the "real" user (the ad buyer) after loading the tweet.

@adegans
Copy link

adegans commented Jun 30, 2023

@adegans One issue I saw is that the ads are embedded as regular tweets in the feed--with the same username. It's only through JS that you can get to the "real" user (the ad buyer) after loading the tweet.

Oh that's hard to filter then... Bummer.

@User123698745
Copy link
Contributor

Well the api is now broken anyways, but just in case:
In TwitterClient.php the variable includePromotedContent is set to true. Maybe setting it to false prevents the spam tweets, but I do not have much hope as that would be way to easy

@adegans
Copy link

adegans commented Jul 1, 2023

Promotedtweet is for sticky tweets I think.

@markcellus
Copy link

markcellus commented Jul 1, 2023

Maybe setting it to false prevents the spam tweets

It doesn't. I already tried. Had to actually check that the tweet's author matches the timeline author and filter out if it doesnt match.

But like you said, it doesnt really matter much now.

@rogerdc
Copy link
Contributor

rogerdc commented Jul 1, 2023

Is that filter part of your feed reader or rss-bridge?

@stephenjamieson
Copy link

Now that the twitter feeds are back for some reason (thank you threads?), I'm not seeing spam

@Aasemoon
Copy link
Author

Ok, I'm now seriously confused. On the public instance, which previously didn't have the spam problem, I can now once again see feed items. On my own instance, which has the latest version of the bridge, I used to get spam, and now I only get the error below. Why is that? What's the difference? Can someone explain this to me?

[Bridge returned error 0! (19553)]

Details
Type: Exception
Code: 0
Message: Unexpected instruction type: TimelinePinEntry
File: lib/TwitterClient.php
Line: 58
Trace
#0 index.php(7): RssBridge->main()
#1 lib/RssBridge.php(15): RssBridge->run()
#2 lib/RssBridge.php(92): DisplayAction->execute()
#3 actions/DisplayAction.php(133): TwitterBridge->collectData()
#4 bridges/TwitterBridge.php(238): TwitterClient->fetchUserTweets()
#5 lib/TwitterClient.php(58)

Context
Query: action=display&bridge=Twitter&context=By username&u=ETH&norep=on&noretweet=on&format=Atom
Version: dev.2023-03-22
OS: Linux
PHP: 8.2.8

@dvikan
Copy link
Contributor

dvikan commented Jul 15, 2023

EDIT: rss-bridge runs master while your instance runs dev.2023-03-22?

Also I have some local uncommitted changes running on rss-bridge.org:

diff --git a/bridges/TwitterBridge.php b/bridges/TwitterBridge.php
index befb8064..9d53e2e2 100644
--- a/bridges/TwitterBridge.php
+++ b/bridges/TwitterBridge.php
@@ -7,7 +7,7 @@ class TwitterBridge extends BridgeAbstract
     const API_URI = 'https://api.twitter.com';
     const GUEST_TOKEN_USES = 100;
     const GUEST_TOKEN_EXPIRY = 10800; // 3hrs
-    const CACHE_TIMEOUT = 300; // 5min
+    const CACHE_TIMEOUT = 60 * 60 * 3;
     const DESCRIPTION = 'returns tweets';
     const MAINTAINER = 'arnd-s';
     const PARAMETERS = [
@@ -223,6 +223,7 @@ EOD
         // Try to get all tweets
         switch ($this->queriedContext) {
             case 'By username':
+        //        return;
                 $cache = RssBridge::getCache();
                 $cache->setScope('twitter');
                 $cache->setKey(['cache']);
@@ -234,11 +235,19 @@ EOD
                 $screenName = trim($screenName);
                 $screenName = ltrim($screenName, '@');
 
-                $data = $api->fetchUserTweets($screenName);
+                try {
+                    $data = $api->fetchUserTweets($screenName);
+                } catch (HttpException $e) {
+                    if ($e->getCode() === 429) {
+                        return;
+                    }
+                    throw $e;
+                }
 
                 break;
 
             case 'By keyword or hashtag':
+                return;
                 // Does not work with the recent twitter changes
                 $params = [
                 'q'                 => urlencode($this->getInput('q')),
@@ -250,6 +259,7 @@ EOD
                 break;
 
             case 'By list':
+                return;
                 // Does not work with the recent twitter changes
                 $params = [
                 'slug'              => strtolower($this->getInput('list')),
@@ -261,6 +271,7 @@ EOD
                 break;
 
             case 'By list ID':
+                return;
                 // Does not work with the recent twitter changes
                 $params = [
                 'list_id'           => $this->getInput('listid'),

@Aasemoon
Copy link
Author

@dvikan Well this certainly fixed something, thank you! It appears I can now see new feed items again. I do still get this error here and there:

Bridge returned error 429! (19554)
Try again later
RSS-Bridge tried to fetch a website. They told us to try again later.

And I've got a single spam post so far.
Also yes to your question.

@dvikan
Copy link
Contributor

dvikan commented Sep 12, 2023

in summary id say this is ads from twitter

@dvikan dvikan closed this as completed Sep 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug-Report Confirmed bug report
Projects
None yet
Development

No branches or pull requests