I am going through the guide here Stream Tweets in real-time | Docs | Twitter Developer Platform and I am able to get tweets coming in the stream for my account. But when I tried to add a second account it did not get added to the stream right away. Instead I had to rerun my rules curl 4 or 5 times and wait for around 5 or 10 minutes before it suddenly began to work. I have now added 2 more accounts to the list and while the original still works and the second account I added continues to appear in the stream, neither of the 2 new accounts added have begun to appear and I have reran the rules curl and reconnecting about 10 times and have waited about 20 minutes for it to go through.
Is there some kind of delay before the rules take effect? Am I supposed to be applying rules after or before connecting? I am trying to do it before.
any help would be appreciated

You should not need to reconnect when rules are changed. Your connection to the stream itself should be persistent, but the rules can be changed independently and should be applied directly to the existing stream.

When you add a new rule, what happens - are you getting back a success result? If you then list the rules, does the new rule show up?

firstly, thank you for your response. I have taken a few steps along solving the problem. I have discovered that I can send a GET to the rules address and get my list of rules. from that I was able to successfully delete my existing rules which may have had some errors. I then ran GET again and verified my rules were empty and added one rule that only includes a “from: user1 from:user2 from:user3 from:user4” where user1234 refer to the usernames I mention in the original post.

My expectation is that having now applied only the one rule and verifying it is present and valid with GET I will see the tweets from those users in the stream.

But running test tweets from the users provides no output to the stream.

I will provide the contents of my add_rules.curl below

this website would not allow links so i replaced the rules url with $rules_url but that is correct I have verified it

curl -X POST $rules_url
-H “Content-type: application/json”
-H “Authorization: Bearer $BEARER_TOKEN”
-d ‘{
“add”: [
{“value”: “from:KevinConlin9 from:devacco88243075 from:Soottoos3 from:RogerGR27531177”}
]
}’
below is the output of me verifying the rule was applied
{“data”:[{“value”:“from:KevinConlin9 from:devacco88243075 from:Soottoos3 from:RogerGR27531177”,“id”:“1328721075086233603”}],“meta”:{“sent”:“2020-11-17T15:26:06.714Z”,“summary”:{“created”:1,“not_created”:0,“valid”:1,“invalid”:0}}}
but when I connect and send a tweet from each of those users my stream provides no output

You may ignore my previous response if you like I have discovered that it does not like it when I try to add multiple users in the same rule. I added them each individually and it works fine now

1 Like

I think the issue is that a space between the filter values is a logical AND, and what you really want there is an OR.

So, you could try the following:

{"value": "from:KevinConlin9 OR from:devacco88243075 OR from:Soottoos3 OR from:RogerGR27531177"}