mirror of
https://github.com/revanced/revanced-manager.git
synced 2025-05-11 18:34:25 +02:00
feat: fetching contributors from GIthub API.
This commit is contained in:
parent
f31641312b
commit
87192e49c6
@ -16,9 +16,10 @@ class GithubAPI {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future latestCommitTime(String org, repoName) async {
|
Future latestCommitTime(String org, repoName) async {
|
||||||
var latestCommit =
|
var repo =
|
||||||
await github.repositories.getRepository(RepositorySlug(org, repoName));
|
await github.repositories.getRepository(RepositorySlug(org, repoName));
|
||||||
var commitTime = latestCommit.pushedAt?.difference(
|
|
||||||
|
var commitTime = repo.pushedAt?.difference(
|
||||||
DateTime.now().toLocal(),
|
DateTime.now().toLocal(),
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -38,10 +39,21 @@ class GithubAPI {
|
|||||||
return "$minutes mins";
|
return "$minutes mins";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future contributors(String org, repoName) async {
|
||||||
|
var contributors =
|
||||||
|
github.repositories.listContributors(RepositorySlug(org, repoName));
|
||||||
|
contributors.forEach((contributor) {
|
||||||
|
print(contributor.login);
|
||||||
|
print(contributor.avatarUrl);
|
||||||
|
});
|
||||||
|
return contributors;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void main(List<String> args) {
|
void main(List<String> args) {
|
||||||
GithubAPI githubAPI = GithubAPI();
|
GithubAPI githubAPI = GithubAPI();
|
||||||
githubAPI.latestRelease('revanced', 'revanced-patches');
|
// githubAPI.latestRelease('revanced', 'revanced-patches');
|
||||||
githubAPI.latestCommitTime("revanced", "revanced-patches");
|
// githubAPI.latestCommitTime("revanced", "revanced-patches");
|
||||||
|
// githubAPI.contributors("revanced", "revanced-manager");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user