Skip to content

Instantly share code, notes, and snippets.

@aconital
Created January 20, 2014 07:27
Show Gist options
  • Save aconital/8516314 to your computer and use it in GitHub Desktop.
Save aconital/8516314 to your computer and use it in GitHub Desktop.
import java.io.IOException;
import java.util.HashSet;
import org.eclipse.egit.github.core.Comment;
import org.eclipse.egit.github.core.Issue;
import org.eclipse.egit.github.core.Repository;
import org.eclipse.egit.github.core.User;
import org.eclipse.egit.github.core.client.GitHubClient;
import org.eclipse.egit.github.core.service.GitHubService;
import org.eclipse.egit.github.core.service.IssueService;
import org.eclipse.egit.github.core.service.RepositoryService;
import org.eclipse.egit.github.core.service.UserService;
public class Main {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
String oAuthToken="d8e93a1f26421f3db2f17c52915da8953b41ee7c";
GitHubClient client=new GitHubClient();
client.setOAuth2Token(oAuthToken);
IssueService issue=new IssueService(client);
RepositoryService repo=new RepositoryService(client);
//create starting date here
//create current date here
//create hashmap<date,num> here
try {
for (Repository repos : repo.getRepositories())
{
for(int i=0;i<issue.getIssues().size();i++)
{
Issue is=issue.getIssues().get(i);
//problem here doesnt find comment
for(Comment comment:issue.getComments(is.getUser().getLogin(), repos.getName(), is.getNumber()))
{
if(!comment.getUser().getLogin().equals(is.getUser().getLogin()))
{
//add one to value of hashmap<comment.date,value+1)
}
}
}
}
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment