I'm working with the github java api and i want to take info about repositories and their users. My question is how can i authorize my requests in order to have full access to the api (5000 requests/hour). Also it would be very hepful if there is way to see any time how many requests are remaining for my application in order not το outreach the api rate limit. The code below is what i do now but with this code i outreach the rate limit.
this.username = ConfigurationParser.parse("username");
this.password = ConfigurationParser.parse("password");
OAuthService oauthService = new OAuthService();
oauthService.getClient().setCredentials(this.username, this.password);
Authorization auth = new Authorization();
try {
auth = oauthService.createAuthorization(auth);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
System.out.println(auth.getApp().getName());
service.getClient().setOAuth2Token(auth.getToken());