Package com.github.jreddit.action

Examples of com.github.jreddit.action.SubmitActions


    } 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();
View Full Code Here

TOP

Related Classes of com.github.jreddit.action.SubmitActions

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.