User user = new User(restClient, Authentication.getUsername(), Authentication.getPassword());
user.connect();
Submissions subms = new Submissions(restClient, user);
MarkActions submAct = new MarkActions(restClient, user);
try {
// Retrieve the 25 hottest submissions of the subreddit
List<Submission> submissions = subms.ofSubreddit("programming", SubmissionSort.HOT, 0, 25, null, null, true);
// Upvote each submission
for (Submission submission : submissions) {
if (!submAct.vote(submission.getFullName(), 1)) {
System.out.println("Could not upvote.");
}
}
} catch (RetrievalFailedException e) {