refactor(connectors): Youtube & Reddit connectors implement BaseConnector

This commit is contained in:
2026-03-10 18:11:33 +00:00
parent e7a8c17be4
commit 2a8d7c7972
2 changed files with 58 additions and 45 deletions

View File

@@ -15,7 +15,15 @@ class RedditAPI(BaseConnector):
self.source_name = "Reddit"
# Public Methods #
def search_new_subreddit_posts(self, search: str, subreddit: str, limit: int) -> list[Post]:
def get_new_posts_by_search(self,
search: str,
subreddit: str,
limit: int
) -> list[Post]:
if not search:
return self._get_new_subreddit_posts(subreddit, limit=limit)
params = {
'q': search,
'limit': limit,
@@ -43,7 +51,7 @@ class RedditAPI(BaseConnector):
return posts
def get_new_subreddit_posts(self, subreddit: str, limit: int = 10) -> list[Post]:
def _get_new_subreddit_posts(self, subreddit: str, limit: int = 10) -> list[Post]:
posts = []
after = None
url = f"r/{subreddit}/new.json"