Reputation:
I want to connect to GitHub by using GitHub api and java.Do i need to do that application as WEB-Application or standalone app
can any one please tell me what are the requirements for that
if possible please provide me sample application to connect GitHub
Upvotes: 2
Views: 4343
Reputation: 105133
You can use jcabi-github (I'm one of its developers):
Github github = new RtGithub("user", "password");
Now you have a client that can help you to manipulate Github entities, for example you can list all issues in a given repository:
Coordinates coords = new Coordinates.Simple("jcabi/jcabi-github");
Repo repo = github.repos().get(coords);
for (Issue issue : repo.issues().iterate(Collections.<String, String>emptyMap())) {
System.out.println("Issue found: #" + issue.number());
}
Upvotes: 2
Reputation: 94499
You may connect to the GitHub API using a standalone application or a web application.
You will need to first register your application with GitHub to obtain your credentials which are used to login when accessing the API. This can be done by creating an application within your user profile on GitHub.
Once you have your credentials I would recommend using an existing library to access the API. I have successfully used the GitHub Java API.
If you want to see an example of how to login with the API see the source code for my blog here.
Upvotes: 4