def store_comment(self, comment): """ Writes comment data from subreddit post to file. :type comment: Comment """ self.bot_log('Storing comment.') self.store('\n* {}\n'.format(comment.body)) self.store('[[{} - {}]]'.format(comment.author, comment.score), False) self.store(FileHelper.get_dictation_pause(), False)
def store_subreddit(self, subreddit): """ Writes segue to next post to file. :type subreddit: str """ if len(self.subreddits) > 1: self.bot_log('Storing subreddit.') content = '\nIn r/{}...'.format(subreddit) self.store(content) self.store(FileHelper.get_dictation_pause(1000), False)
def store_post(self, post): """ Writes subreddit post data to file. :type post: Submission """ self.bot_log('Storing post.') self.store('\n***{}***\n {}\n\n'.format(post.title, post.selftext)) self.store('[[{} - {}]]'.format(post.author, post.score), False) self.store(FileHelper.get_dictation_pause(1000), False)
def store_intro(self): """ Writes intro for the file about the subreddits. """ self.bot_log('Storing intro.') content = "Here's what's happening with " content += self.get_human_readable_subreddit_list() content += "\nLet's get started." self.store(content) self.store(FileHelper.get_dictation_pause(1000), False)