Rules: from:Quark_Hadron -is:reply
I tried to reply on my post/some post, turn out it still included in the stream
What are the other rules you have in the stream? Is there an older one there also? IS the rule ID the same in the matched rule in the json?
{ value: ‘Quark Hadron OR Quark Hadron#1337’, tag: ‘Mentioned about Quark’ },
{ value: ‘from:Quark_Hadron -is:reply’, tag: ‘From Quark excludes Reply’ },
{ value: ‘to:Quark_Hadron’, tag: ‘Replied Quark’ },
{ value: ‘retweets_of:Quark_Hadron’, tag: ‘Retweet Quark's tweet’ },
I suspect this matches a reply to you. Remember that each rule is applied separately, together you can think of them as a logical OR, not AND.
Check the response for the matched rule in the json and it will tell you what rule it matched.
To fix this specific one you may want to test to see if to:Quark_Hadron -from:Quark_Hadron will work.
So
{ value: ‘Quark Hadron OR Quark Hadron#1337’, tag: ‘Mentioned about Quark’ },
{ value: ‘from:Quark_Hadron -is:reply’, tag: ‘From Quark excludes Reply’ },
{ value: ‘to:Quark_Hadron -from:Quark_Hadron’, tag: ‘Replied Quark’ },
{ value: ‘retweets_of:Quark_Hadron’, tag: ‘Retweet Quark's tweet’ },
instead?
Yeah that looks like it would work, but it depends on what exactly you want overall, so i would keep checking the json to see what rules matched to adjust.
SkametD
#7
[quote=“Quark_Hadron, post:1, topic:184277, full:true”]
Rules: from:Quark_Hadron -is:reply
I tried to reply on my post/some post, turn out it still in video
Seems to solve the problem!
Another question related to streams, how are twitter discord bot like https://tweetshift.com are able to stream lots of accounts. Once the bot is added to server, owner can use the bot to stream there account. Checked twitter api and doesn’t seem to see any similar thing.
I’m not familiar with tweetshift bot, but from the looks of it, once you have made a user log in Log in with Twitter | Docs | Twitter Developer Platform and you have their access token, you can Like, Retweet, and tweet on behalf of a user - so that’s how tweetshift would do that.
To “automatically post Tweets right into a Discord channel.” they can either poll for new tweets with the REST API and get tweet timelines, or use the stream API - and route the right twitter accounts to the right discords and channels in their own code.
Filtering can either be achieved by them adding extra rules for you, or more likely they get all tweets from an account and filter it themselves in their own code.
They could either use separate rules, or bundle lots of users into 1 rule, like “from:user1 OR from:user2 OR...” etc. and then split / separate those out themselves.
To scale the bot up, lets say streaming 1000 Twitter account, which would be the best way to do it? Also, what do you mean by poll for new tweets? Any example?
For that many accounts, i would loop over the accounts timelines using GET /2/users/:id/tweets | Docs | Twitter Developer Platform
Using app only auth, you can make 1500 calls in 15 minutes, so every 15 minutes, you can make 1 request and get the latest tweets for each of your 1000 users. Using the since_id to restrict results so that the monthly quota does not get eaten up with repeated requests.
Are there any other ways to make it more instant? Lets say as soon as a user post tweet, it get sends, can start with around 100 accounts first.
Haven’t seen anything about that from twitter- I think the filter stream is not going to change drastically in the future.
So the only way were the one you suggested earlier? Would it be possible to do every minute request for 100 accounts?
Sure, every minute for 100 accounts is 1500 calls in 15 minutes too. Although I would add an extra second between calls and make sure to use the rate limit headers and call the endpoint serially not in parallel to make this work better.
How about every 3 seconds, check 100 accounts?
Also, could you please explain the part where
Although I would add an extra second between calls and make sure to use the rate limit headers and call the endpoint serially not in parallel to make this work better.
Yeah this is because the rate limits are not perfectly exact to the second, there is some delay that should be accounted for too. Adding an extra second buffer is usually more than enough.