diff --git a/connectors/reddit_connector.py b/connectors/reddit_connector.py index fa701ea..6556807 100644 --- a/connectors/reddit_connector.py +++ b/connectors/reddit_connector.py @@ -68,6 +68,7 @@ class RedditConnector(BaseConnector): for item in data['data']['children']: post_data = item['data'] post = Post( + id=post_data['id'], author=post_data['author'], title=post_data['title'], content=post_data.get('selftext', ''), diff --git a/dto/post.py b/dto/post.py index c9c5f91..90bf1c6 100644 --- a/dto/post.py +++ b/dto/post.py @@ -1,10 +1,13 @@ class Post: - def __init__(self, author: str, + def __init__(self, + id: str, + author: str, title: str, content: str, url: str, timestamp: float, source: str): + self.id = id self.author = author self.title = title self.content = content