diff --git a/.gitignore b/.gitignore
index 748b458..7423593 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,4 @@
# Project exclude paths
-/node_modules/
\ No newline at end of file
+/node_modules/
+
+db.json
\ No newline at end of file
diff --git a/db.json b/db.json
deleted file mode 100644
index 8cc14f7..0000000
--- a/db.json
+++ /dev/null
@@ -1 +0,0 @@
-{"counts":{"nftm.art":[1,0],"localhost":[4,2]},"latest":{}}
\ No newline at end of file
diff --git a/index.js b/index.js
index b0ef2a0..585e09a 100644
--- a/index.js
+++ b/index.js
@@ -156,6 +156,8 @@ app.get('/votes/:site', (req, res) => {
return res.json({percent: getPercent(site), success: true});
});
+app.use(express.static('public'));
+
app.options('*', cors());
function saveAndCleanup() {
@@ -166,8 +168,8 @@ function saveAndCleanup() {
setInterval(saveAndCleanup, 86400000)
try {
- app.listen(3000, () => {
- console.log('App listening on port 3000!');
+ app.listen(6721, () => {
+ console.log('App listening on port 6721!');
});
} catch (e) {
console.log("Saving DB");
diff --git a/public/instant-opinion.min.js b/public/instant-opinion.min.js
new file mode 100644
index 0000000..4ef2c9b
--- /dev/null
+++ b/public/instant-opinion.min.js
@@ -0,0 +1 @@
+!async function(){const n="https://instant-opinion.dbuidl.com/votes/"+window.location.hostname,t=(n=>document.querySelectorAll(n))(".instant-opinion"),i='',o='';async function e(n,t="GET"){try{const i=await fetch(n,{method:t});return await i.json()}catch(n){return!1}}async function s(t,i,o){const s=await e(`${n}/${t}`,"POST");s&&"percent"in s&&(i.querySelector(".instant-opinion-percent").innerText=s.percent+"%",o.style.width=s.percent+"%")}async function c(){const t=await e(`${n}`);return!!(t&&"percent"in t)&&t.percent}for(let n=0;n
"+h+"%
":"50%
")+"