-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathReleaseStatistics.html
71 lines (61 loc) · 2.36 KB
/
ReleaseStatistics.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<!DOCTYPE html>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script type="text/javascript">
function showStats(data) {
var reponame = data[0].url.substring(data[0].url.indexOf("/sdcTools")+10,data[0].url.indexOf("/releases"));
var html = '';
html += "<div class='row release'>" +
"<h3>" + reponame + " " + data[0].tag_name + "</h3>";
html += "<a href='" + data[0].html_url + "' target='_blank'>" + data[0].html_url + "</a>";
html += "<h4>Release Info:</h4>";
html += "<ul>";
html += "<li>Release Author: <a href='" + data[0].author.html_url + "'>" + data[0].author.login +"</a><br></li>";
html += "<li>Published on: " + data[0].published_at.split("T")[0] + "</li>";
html += "</ul>";
if(data[0].assets.length != 0) {
html += "<h4>Download Info: </h4>";
html += "<ul>";
$.each(data[0].assets, function(index, asset) {
var assetSize = (asset.size / 1048576.0).toFixed(2);
html += "<li>" + asset.name + " (" + assetSize + " MB) - Downloaded " +
asset.download_count + " times.<br><i>Last updated on " + asset.updated_at.split("T")[0] + "</i></li>";
});
html += "</ul>";
}
else{
html += "<h4>Download Info: </h4>";
html += "<ul><li>Only sources to download; no download info</li></ul>";
}
html += "</div>";
html += "<a href='https://github.com/sdcTools/UserSupport'>Return to UserSupport on GitHub</a><p></p>"
var resultDiv = $("#stats-result");
resultDiv.append(html);
}
</script>
<script type="text/javascript">
$.getJSON("https://api.github.com/repos/sdcTools/tauargus/releases", showStats).fail(showStats);
$.getJSON("https://api.github.com/repos/sdcTools/muargus/releases", showStats).fail(showStats);
$.getJSON("https://api.github.com/repos/sdcTools/sdcmicro/releases", showStats).fail(showStats);
$.getJSON("https://api.github.com/repos/sdcTools/sdctable/releases", showStats).fail(showStats);
</script>
<html>
<style>
html {font-family: 'Roboto', sans-serif}
.release {
background-color: rgba(52, 152, 219, 0.2);
border: solid 1px rgba(52, 152, 219, 0.4);
padding: 20px;
border-radius: 5px;
margin-bottom: 10px;
}
</style>
<head>
<title>Release Statistics via GitHub</title>
</head>
<body>
<div class="container">
<div class="row" id="stats-result">
</div>
</div>
</body>
</html>