Examples of StackExchangeApiClient


Examples of com.google.code.stackexchange.client.StackExchangeApiClient

            printHelp(options);           
        } else if(line.hasOption(APPLICATION_KEY_OPTION)) {
        final String keyValue = line.getOptionValue(APPLICATION_KEY_OPTION);
       
        final StackExchangeApiClientFactory factory = StackExchangeApiClientFactory.newInstance(keyValue);
        final StackExchangeApiClient client = factory.createStackExchangeApiClient();
       
        if(line.hasOption(ID_OPTION)) {
          String idValue = line.getOptionValue(ID_OPTION);
          List<User> users = client.getUsers(Long.valueOf(idValue));
          printResult(users.get(0));
        } else {
          List<User> users = client.getUsers();
          for (User user : users) {
          printResult(user);
        }
        }
        } else {
View Full Code Here

Examples of com.google.code.stackexchange.client.StackExchangeApiClient

            printHelp(options);
        } else if(line.hasOption(APPLICATION_KEY_OPTION)) {
        final String keyValue = line.getOptionValue(APPLICATION_KEY_OPTION);
       
        final StackExchangeApiClientFactory factory = StackExchangeApiClientFactory.newInstance(keyValue);
        final StackExchangeApiClient client = factory.createStackExchangeApiClient();
       
        if(line.hasOption(ID_OPTION)) {
          String idValue = line.getOptionValue(ID_OPTION);
          List<Answer> answersByUser = client.getAnswersByUsers(Long.valueOf(idValue));
          for (Answer answer : answersByUser) {
          printResult(answer);
        }
        }
        } else {
View Full Code Here

Examples of com.google.code.stackexchange.client.StackExchangeApiClient

            printHelp(options);           
        } else if(line.hasOption(APPLICATION_KEY_OPTION)) {
        final String keyValue = line.getOptionValue(APPLICATION_KEY_OPTION);
       
        final StackExchangeApiClientFactory factory = StackExchangeApiClientFactory.newInstance(keyValue);
        final StackExchangeApiClient client = factory.createStackExchangeApiClient();
       
        if(line.hasOption(ID_OPTION)) {
          String idValue = line.getOptionValue(ID_OPTION);
          List<Question> question = client.getQuestions(Long.valueOf(idValue));
          printResult(question.get(0));
        } else {
          List<Question> questions = client.getQuestions(EnumSet.of(FilterOption.INCLUDE_BODY, FilterOption.INCLUDE_COMMENTS));
          for (Question question : questions) {
            printResult(question);
          }
         
          List<PostTimeline> questionTimeline = client.getQuestionsTimeline(2420689L);
          for (PostTimeline timeline : questionTimeline) {
          printResult(timeline);
        }
        }
        } else {
View Full Code Here

Examples of com.google.code.stackexchange.client.StackExchangeApiClient

            printHelp(options);
        } else if(line.hasOption(APPLICATION_KEY_OPTION)) {
        final String keyValue = line.getOptionValue(APPLICATION_KEY_OPTION);
       
        final StackExchangeApiClientFactory factory = StackExchangeApiClientFactory.newInstance(keyValue);
        final StackExchangeApiClient client = factory.createStackExchangeApiClient();
       
        if(line.hasOption(ID_OPTION)) {
          String idValue = line.getOptionValue(ID_OPTION);
          List<Comment> userComments = client.getUsersComments(Long.valueOf(idValue));
          for (Comment comment : userComments) {
            printResult(comment);
          }
        }
        } else {
View Full Code Here

Examples of com.google.code.stackexchange.client.StackExchangeApiClient

            printHelp(options);
        } else if(line.hasOption(APPLICATION_KEY_OPTION)) {
        final String keyValue = line.getOptionValue(APPLICATION_KEY_OPTION);
       
        final StackExchangeApiClientFactory factory = StackExchangeApiClientFactory.newInstance(keyValue);
        final StackExchangeApiClient client = factory.createStackExchangeApiClient();
       
        List<Statistics> stats = client.getStatistics();
        printResult(stats);
       
        } else {
            printHelp(options);
        }
View Full Code Here

Examples of com.google.code.stackexchange.client.StackExchangeApiClient

            printHelp(options);           
        } else if(line.hasOption(APPLICATION_KEY_OPTION)) {
        final String keyValue = line.getOptionValue(APPLICATION_KEY_OPTION);
       
        final StackExchangeApiClientFactory factory = StackExchangeApiClientFactory.newInstance(keyValue);
        final StackExchangeApiClient client = factory.createStackExchangeApiClient();
       
      List<Badge> badges = client.getBadgesByName();
      System.out.println("============ Badges ============");
      for (Badge badge : badges) {
        printResult(badge);
      }
      List<Tag> tags = client.getTags();
      System.out.println("============ Tags ============");
      for(Tag tag : tags) {
        printResult(tag);
      }
        } else {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.