mirror of
https://github.com/angryip/ipscan.git
synced 2025-10-26 11:18:17 +00:00
48 lines
1.2 KiB
HTML
48 lines
1.2 KiB
HTML
---
|
|
title: Download stats from GitHub
|
|
layout: default
|
|
priority: 0.5
|
|
---
|
|
|
|
<h1>{{ page.title }}</h1>
|
|
|
|
<style>
|
|
#assets .current {
|
|
font-weight: bold;
|
|
}
|
|
</style>
|
|
|
|
<ul id="assets">
|
|
<li>Loading...</li>
|
|
</ul>
|
|
|
|
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
|
|
<script>
|
|
var list = $('#assets');
|
|
$.get('https://api.github.com/repos/angryip/ipscan/releases', function(releases) {
|
|
list.empty();
|
|
var assets = [];
|
|
var total = 0;
|
|
$.each(releases, function(i, release) {
|
|
$.each(release.assets, function(j, asset) {
|
|
if (i == 0) asset.current_release = true;
|
|
assets.push(asset);
|
|
total += asset.download_count;
|
|
});
|
|
});
|
|
|
|
list.append('Total ' + total + ' downloads from GitHub');
|
|
|
|
assets.sort(function(a1, a2) {
|
|
return a2.download_count - a1.download_count;
|
|
});
|
|
|
|
$.each(assets, function(i, asset) {
|
|
var li = $('<li><a href="' + asset.browser_download_url + '">' + asset.name + '</a>: ' +
|
|
asset.download_count + ' downloads since ' + asset.created_at.replace(/T.*/, '') + '</li>')
|
|
.appendTo(list);
|
|
if (asset.current_release) li.find('a').addClass('current');
|
|
});
|
|
});
|
|
</script>
|