From 879aa3e5ef519d12f4161d42c42c8576800e986e Mon Sep 17 00:00:00 2001 From: Hykilpikonna Date: Wed, 3 Nov 2021 16:45:46 -0400 Subject: [PATCH] [+] Create platform-independent user and posting classes --- collect/utils.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/collect/utils.py b/collect/utils.py index 98143fa..f87556b 100644 --- a/collect/utils.py +++ b/collect/utils.py @@ -28,6 +28,30 @@ class Config: telegram_userid: int +@dataclass +class GeneralUser: + # Username + username: str + # A measurement of a user's popularity, such as followers count + popularity: int + # Which platform is this user from + platform: str + + +@dataclass +class Posting: + # Which platform did the user post on + platform: str + # Username on that platform + username: str + # Full text of the post's content + text: str + # Popularity of the post + popularity: int + # Is it a repost + repost: bool + + def load_config() -> Config: """ Load config using JSON5, from either the local file ~/config.json5 or from the environment variable named config.