From 6eab4a41b3284943ad97cc3f73078aa353d65794 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Tue, 9 Aug 2022 02:20:15 +0200 Subject: [PATCH] update comment --- main.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index 0eeb3d7..8ae8996 100644 --- a/main.py +++ b/main.py @@ -87,7 +87,7 @@ class Listener(StreamingClient): def on_connect(self): print(f"Début du scroll sur Twitter...") - def get_user(self, uid: int) -> str: + def _get_user(self, uid: int) -> str: """Return username by ID, with cache support""" # If not cached if not uid in self.cache: @@ -101,7 +101,7 @@ class Listener(StreamingClient): def on_tweet(self, tweet: Tweet): # Check if the tweet is not a retweet if not tweet.text.startswith("RT @"): - username = self.get_user(tweet.author_id) + username = self._get_user(tweet.author_id) # Clean the tweet lastWord = cleanTweet(tweet.text) @@ -349,6 +349,7 @@ def start(): stream.add_rules([StreamRule(rule) for rule in rules]) break + # Apply the filter stream.filter(threaded=True, tweet_fields="author_id")