RedditToolkit
- retries (int): Number of retries for API requests in case of failure.
- delay (float): Delay between retries in seconds.
- reddit (Reddit): An instance of the Reddit client.
init
- retries (int): Number of times to retry the request in case of failure. Defaults to
3
. - delay (int): Time in seconds to wait between retries. Defaults to
0
. - timeout (float): Timeout for API requests in seconds. Defaults to
None
.
collect_top_posts
- subreddit_name (str): The name of the subreddit to collect posts from.
- post_limit (int): The maximum number of top posts to collect. Defaults to
5
. - comment_limit (int): The maximum number of top comments to collect per post. Defaults to
5
.
perform_sentiment_analysis
- data (List[Dict[str, Any]]): A list of dictionaries containing Reddit post data and comments.
track_keyword_discussions
- subreddits (List[str]): A list of subreddit names to search within.
- keywords (List[str]): A list of keywords to track in the subreddit discussions.
- post_limit (int): The maximum number of top posts to collect per subreddit. Defaults to
10
. - comment_limit (int): The maximum number of top comments to collect per post. Defaults to
10
. - sentiment_analysis (bool): If True, performs sentiment analysis on the comments. Defaults to
False
.