Can't Retrieve Random Thread from Specified Subreddit
After running the program a few times, I've noticed that the random parameter in the config.toml file doesn't actually select a random thread from the subreddit. When comparing with the threads in a given Subreddit, the program is iterating through the Hot posts.
Fixed my own issue. Might not be pretty, but it gets the job done and should still interface with the duplication check function .
Here's the snippet of code that now randomly selects a submission from the subreddit.
Also had to import random at the beginning of the file
else:
threads = subreddit.hot(limit=100)
# Random submission selection
submissionarray = []
for submission in threads:
submissionarray.append(submission)
if len(submissionarray) > 0:
x = random.randrange(0, len(submissionarray), 2)
submission = submissionarray[x]
# submission = get_subreddit_undone(threads, subreddit)
submission = check_done(submission) # double-checking