} catch (ParseException e1) {
e1.printStackTrace();
}
// Enable user actions
SubmitActions submitActions = new SubmitActions(restClient, user);
try {
// Captcha requester
Captcha c = new Captcha(restClient);
// Check if a captcha is needed for this user
if (c.needsCaptcha(user)) {
// Ask for a new Captcha identification
String iden = c.newCaptcha(user);
// Show the captcha to you
showCaptcha(iden);
// Ask for captcha solution
Scanner sc = new Scanner(System.in);
System.out.println("Enter the solution to the Captcha (see the window opened just now):");
String solution = sc.nextLine();
sc.close();
// Submit the link with captcha
submitActions.submitLink("Funny dog image", "http://www.boredpanda.com/blog/wp-content/uploads/2014/03/funny-cats-dogs-stuck-furniture-1.jpg", "funny", iden, solution);
} else {
// Submit the link without captcha
submitActions.submitLink("Funny dog image", "http://www.boredpanda.com/blog/wp-content/uploads/2014/03/funny-cats-dogs-stuck-furniture-1.jpg", "funny", "", "");
}
} catch (RetrievalFailedException e) {
e.printStackTrace();