Package com.github.api.v2.services.example

Examples of com.github.api.v2.services.example.FeedSample


   * @param args
   *            the arguments
   */
  public static void main(String[] args) {
    GitHubServiceFactory factory = GitHubServiceFactory.newInstance();
    ObjectService service = factory.createObjectService();
    List<Tree> trees = service.getTree("facebook", "tornado", "7b80c2f4db226d6fa3a7");
    for (Tree tree : trees) {
      printResult(tree);         
    }
    List<Blob> blobs = service.getBlobs("facebook", "tornado", "7b80c2f4db226d6fa3a7");
    for (Blob blob : blobs) {
      printResult(blob);
    }
    System.out.println(convertStreamToString(service.getObjectContent("facebook", "tornado", "7b80c2f4db226d6fa3a7f3dfa59277da1d642f91")));
  }
View Full Code Here


   * @throws Exception
   *             the exception
   */
  public static void main(String[] args) throws Exception {
    GitHubServiceFactory factory = GitHubServiceFactory.newInstance();
    OrganizationService service = factory.createOrganizationService();
    Organization organization = service.getOrganization("github");
    printResult(organization);
    List<User> publicMembers = service.getPublicMembers("github");
    for (User user : publicMembers) {
      printResult(user);
    }
    List<Repository> publicRepositories = service.getPublicRepositories("github");
    for (Repository repository : publicRepositories) {
      printResult(repository);     
    }
  }
View Full Code Here

   * @param args
   *            the arguments
   */
  public static void main(String[] args) {
    GitHubServiceFactory factory = GitHubServiceFactory.newInstance();
    PullRequestService service = factory.createPullRequestService();
    List<PullRequest> pullRequests = service.getPullRequests("technoweenie", "faraday");
    for (PullRequest pullRequest : pullRequests) {
      printResult(pullRequest);         
    }
    PullRequest pullRequest = service.getPullRequest("technoweenie", "faraday", 15);
    printResult(pullRequest);
  }
View Full Code Here

   * @throws Exception
   *             the exception
   */
  public static void main(String[] args) throws Exception {
    GitHubServiceFactory factory = GitHubServiceFactory.newInstance();
    RepositoryService service = factory.createRepositoryService();
    List<Repository> repositories = service.searchRepositories("hadoop");
    for (Repository repository : repositories) {
      printResult(repository);
    }
    Map<Language, Long> breakDown = service.getLanguageBreakdown("facebook", "tornado");
    System.out.println(breakDown);
    ZipInputStream zip = service.getRepositoryArchive("nabeelmukhtar", "github-java-sdk", Repository.MASTER);
    ZipEntry entry = null;
    while ((entry = zip.getNextEntry()) != null) {
      System.out.println(entry.getName());
    }
  }
View Full Code Here

   * @param args
   *            the arguments
   */
  public static void main(String[] args) {
    GitHubServiceFactory factory = GitHubServiceFactory.newInstance();
    UserService service = factory.createUserService();
    List<User> users = service.searchUsersByName("john");
    for (User user : users) {
      printResult(user);     
    }
    User user = service.getUserByEmail("nabeelmukhtar@yahoo.com");
    printResult(user);
  }
View Full Code Here

  /* (non-Javadoc)
   * @see com.github.api.v2.services.JobService#getJob(java.lang.String)
   */
  @Override
  public Job getJob(String id) {
    GitHubApiUrlBuilder builder = createGitHubApiUrlBuilder(GitHubApiUrls.JobApiUrls.GET_JOB_URL);
        String                apiUrl  = builder.withField(ParameterNames.ID, id).buildUrl();
        JsonObject json = unmarshall(callApiGet(apiUrl));
        return unmarshall(new TypeToken<Job>(){}, json);       
  }
View Full Code Here

  /* (non-Javadoc)
   * @see com.github.api.v2.services.JobService#searchFullTimeJobs(java.lang.String)
   */
  @Override
  public List<Job> searchFullTimeJobs(String query) {
    GitHubApiUrlBuilder builder = createGitHubApiUrlBuilder(GitHubApiUrls.JobApiUrls.SEARCH_JOBS_URL);
        String                apiUrl  = builder.withParameter(ParameterNames.SEARCH, query).withParameter(ParameterNames.FULL_TIME, "true").buildUrl();
        JsonElement json = unmarshallList(callApiGet(apiUrl));
        return unmarshall(new TypeToken<List<Job>>(){}, json)
    }
View Full Code Here

  /* (non-Javadoc)
   * @see com.github.api.v2.services.JobService#searchFullTimeJobs(java.lang.String, java.lang.String)
   */
  @Override
  public List<Job> searchFullTimeJobs(String query, String location) {
    GitHubApiUrlBuilder builder = createGitHubApiUrlBuilder(GitHubApiUrls.JobApiUrls.SEARCH_JOBS_URL);
        String                apiUrl  = builder.withParameter(ParameterNames.FULL_TIME, "true").withParameter(ParameterNames.SEARCH, query).withParameter(ParameterNames.LOCATION, location).buildUrl();
        JsonElement json = unmarshallList(callApiGet(apiUrl));
        return unmarshall(new TypeToken<List<Job>>(){}, json)
  }
View Full Code Here

  /* (non-Javadoc)
   * @see com.github.api.v2.services.JobService#searchFullTimeJobs(java.lang.String, com.github.api.v2.schema.GeoLocation)
   */
  @Override
  public List<Job> searchFullTimeJobs(String query, GeoLocation location) {
    GitHubApiUrlBuilder builder = createGitHubApiUrlBuilder(GitHubApiUrls.JobApiUrls.SEARCH_JOBS_URL);
        String                apiUrl  = builder.withParameter(ParameterNames.FULL_TIME, "true").withParameter(ParameterNames.SEARCH, query).withParameter(ParameterNames.LATITUDE, String.valueOf(location.getLatitude())).withParameter(ParameterNames.LONGITUDE, String.valueOf(location.getLongitude())).buildUrl();
        JsonElement json = unmarshallList(callApiGet(apiUrl));
        return unmarshall(new TypeToken<List<Job>>(){}, json)
  }
View Full Code Here

  /* (non-Javadoc)
   * @see com.github.api.v2.services.JobService#searchJobs(java.lang.String)
   */
  @Override
  public List<Job> searchJobs(String query) {
    GitHubApiUrlBuilder builder = createGitHubApiUrlBuilder(GitHubApiUrls.JobApiUrls.SEARCH_JOBS_URL);
        String                apiUrl  = builder.withParameter(ParameterNames.SEARCH, query).buildUrl();
        JsonElement json = unmarshallList(callApiGet(apiUrl));
        return unmarshall(new TypeToken<List<Job>>(){}, json)
  }
View Full Code Here

TOP

Related Classes of com.github.api.v2.services.example.FeedSample

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.