0

I can't add "list:XXXXXXXXXX" to my rules (I can add other rules though and they work). What I'm missing?

import tweepy

class TweetPrinter(tweepy.StreamingClient):
    def on_tweet(self, tweet):
        print(tweet)   
printer = TweetPrinter(bearer_token)
printer.add_rules(tweepy.StreamRule("list:XXXXXXXXXX")) 
printer.filter()

After executing this code instead of creating a StreamRule with an id, I got this (checking the list of the rules with printer.get_rules():

Response(data=None, includes={}, errors=[], meta={'sent': '2022-12-27T00:23:44.073Z', 'result_count': 0})

I'm using Tweepy 4.12 and Twitter API v2.

arthur
  • 348
  • 4
  • 16
  • 1
    `list:` doesn't seem to be a keyword that's available in the twitter api v2 (https://developer.twitter.com/en/docs/twitter-api/tweets/filtered-stream/integrate/build-a-rule) Are you trying to search for the text "list:XXXXXX" or? – kingerman88 Dec 29 '22 at 18:16
  • Hm.. Looks like you're right. It's not available for Filtered stream specifically (but available otherwise). Thanks for the hint! – arthur Jan 02 '23 at 02:29

0 Answers0