import praw reddit = praw.Reddit(client_id='my_client_id', client_secret='my_client_secret', username='my_username', password='my_password', user_agent='my_user_agent') submission = reddit.submission(id='abcdef') # get submission by ID top_score = submission.score # get top score of submission print(top_score)
import praw reddit = praw.Reddit(client_id='my_client_id', client_secret='my_client_secret', username='my_username', password='my_password', user_agent='my_user_agent') submission = reddit.submission(id='abcdef') # get submission by ID submission.upvote() # upvote the submission print("Upvoted the submission!")This example shows how to upvote a submission by calling the upvote method on the Submission object. Overall, these examples demonstrate how the praw.models Submission module can be used in Python to interact with Reddit posts.