ADD requirements.txt & Database class

This commit is contained in:
2025-11-06 15:44:45 +00:00
parent a9778f26b2
commit be61a9c7ae
3 changed files with 30 additions and 0 deletions

View File

@@ -8,6 +8,7 @@ class RedditConnector(BaseConnector):
self.url = "https://www.reddit.com/"
self.source_name = "Reddit"
# Public Methods #
def get_top_posts(self, limit: int = 10, timeframe: str = 'day') -> list[Post]:
params = {
'limit': limit,
@@ -52,6 +53,7 @@ class RedditConnector(BaseConnector):
data = self._fetch_data(url, params)
return self._parse_posts(data)
## Private Methods ##
def _parse_posts(self, data) -> list[Post]:
posts = []
for item in data['data']['children']: