From 097648e444935aece3ef78abc6b13db55e25ce06 Mon Sep 17 00:00:00 2001
From: ExploShot
Date: Sun, 11 Apr 2021 08:33:08 +0200
Subject: [PATCH 1/4] Auto get release Info test
---
get/getReleaseInfo.js | 34 +++++++++++++++++++++++++++++
get/gui/latest/linux/rpm/index.html | 5 +++++
2 files changed, 39 insertions(+)
create mode 100644 get/getReleaseInfo.js
diff --git a/get/getReleaseInfo.js b/get/getReleaseInfo.js
new file mode 100644
index 0000000..9a38186
--- /dev/null
+++ b/get/getReleaseInfo.js
@@ -0,0 +1,34 @@
+function getLatestReleaseInfo(releaseType) {
+ $.getJSON("https://api.github.com/repos/qwertycoin-org/qwertycoin-gui/releases/latest").done((data) => {
+ var downloadUrl;
+ var downloads;
+ var lastUpdate;
+ var assetName;
+ var releaseName = data.name;
+
+ for (asset in data.assets) {
+ if (asset.name.indexOf(releaseType) !== -1) {
+ downloadUrl = asset.browser_download_url;
+ downloads = asset.download_count;
+ lastUpdate = asset.updated_at;
+ assetName = asset.name
+ }
+ }
+
+ var hour = 60 * 60 * 1000;
+ var day = 24 * hour;
+ var timeDiff = new Date() - new Date(lastUpdate);
+ var timeAgo;
+
+ if (timeDiff < day) {
+ timeAgo = (timeDiff / hour).toFixed(1) + " hours ago";
+ } else {
+ timeAgo = (timeDiff / day).toFixed(1) + " days ago";
+ }
+
+ var relInfo = `${assetName} was updated ${timeAgo} and downloaded ${downloads} times`;
+ $(".download").attr("href", downloadUrl);
+ $(".release-info").text(relInfo);
+
+ })
+}
\ No newline at end of file
diff --git a/get/gui/latest/linux/rpm/index.html b/get/gui/latest/linux/rpm/index.html
index 18c7d51..abac29a 100644
--- a/get/gui/latest/linux/rpm/index.html
+++ b/get/gui/latest/linux/rpm/index.html
@@ -12,6 +12,11 @@
Redirecting to: https://github.com/qwertycoin-org/qwertycoin-gui/releases/download/v6.0.2/qwertycoin-gui-v6.0.2-linux.rpm
+ Download
+