Skip to content

Instantly share code, notes, and snippets.

View noga-dev's full-sized avatar
🙊
Apes Together Strong

Agon Noga noga-dev

🙊
Apes Together Strong
View GitHub Profile
@noga-dev
noga-dev / commitCount.dart
Last active June 29, 2021 19:38 — forked from codsane/commitCount.py
Simplest way to get commit count of a GitHub repo using the API
import 'dart:html';
void main() async {
print(await getCommits(repo: 'river_pod', owner: 'rrousselGit'));
}
Future<String> getCommits({required String repo, required String owner}) async => RegExp(r'(\d+)')
.allMatches((await HttpRequest.request(
'https://api.github.com/repos/$owner/$repo/commits?per_page=1'))
.responseHeaders['link']!)