diff --git a/.gitignore b/.gitignore index 58f0d03..db4027f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,5 @@ .env -env/ + +bin/ +lib/ +pyvenv.cfg diff --git a/main.py b/main.py index 663ab61..42d3d78 100644 --- a/main.py +++ b/main.py @@ -63,7 +63,7 @@ class Listener(StreamListener): self.api = api self.accounts = users self.forcelist = forcelist - self.listOfFriendsID = getFriendsID(api, users) + forcelist + self.listOfFriendsID = getFriendsID(api, users) + getIDs(api, forcelist) def on_connect(self): print(f"Scroll sur Twitter avec les abonnements de @{', @'.join(self.accounts)} comme timeline et ces comptes : @{', @'.join(self.forcelist)}...") @@ -139,6 +139,13 @@ def getFriendsID(api, users: list) -> list: liste.extend(api.friends_ids(user)) return list(set(liste)) +def getIDs(api, users: list) -> list: + """Get all the ID of users""" + liste = [] + for user in users: + liste.append(api.get_user(user)._json["id"]) + return list(set(liste)) + def seniority(date: str) -> bool: """Return True only if the given string date is less than one day old.""" datetimeObject = datetime.strptime(date, "%a %b %d %H:%M:%S +0000 %Y") # convert String format to datetime format