🎉 create first files; nightly check-in

master
Martin Zwigl 2025-02-22 22:45:51 +01:00
parent 92b68286d8
commit 1748fab8d6
6 changed files with 93 additions and 0 deletions

1
apps/coin_info/Changelog Normal file
View File

@ -0,0 +1 @@
0.01: Initial creation

7
apps/coin_info/README.md Normal file
View File

@ -0,0 +1,7 @@
# Crypto-Coin Info
Crypto-Coins Infos with the help of the Coinmarketcap API
## Creator
Martin Zwigl

BIN
apps/coin_info/app.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
apps/coin_info/app_mono.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1005 B

View File

@ -0,0 +1,63 @@
<html>
<head>
<link rel="stylesheet" href="../../css/spectre.min.css">
</head>
<body>
<h3>Set Coinmarketcap API key for Crypto-Coin Info</h3>
<p><input id="apikey" onkeyup="checkInput()" style="width:90%; margin: 3px"></input><button id="upload" class="btn btn-primary">Save key</button></p>
<h4>Where to get your personal API key?</h4>
<p>Go to <a href="https://coinmarketcap.com/api/">https://coinmarketcap.com/api/</a> and sign up for a free account.<br>
There are various pricing models with various degrees of API access. As of 2025.02.22 there is also a free tier.</p>
<script src="../../core/lib/interface.js"></script>
<script>
function checkInput() {
if(document.getElementById("apikey").value==="") {
document.getElementById('upload').disabled = true;
} else {
document.getElementById('upload').disabled = false;
}
}
checkInput();
var settings = {};
function onInit(){
console.log("Loading settings from BangleJs...");
try {
Util.readStorageJSON("coin_info.cmc_key.json", data=>{
if(data){
settings = data;
console.log("Got settings", settings);
document.getElementById("apikey").value = settings.apikey;
console.log("Loaded apikey from BangleJs.");
checkInput();
}
});
} catch(ex) {
console.log("(Warning) Could not load apikey from BangleJs.");
console.log(ex);
}
}
document.getElementById("upload").addEventListener("click", function() {
try {
settings.apikey = document.getElementById("apikey").value;
Util.showModal("Saving...");
Util.writeStorage("coin_info.cmc_key.json", JSON.stringify(settings), ()=>{
Util.hideModal();
});
console.log("Sent settings!");
} catch(ex) {
console.log("(Warning) Could not write settings to BangleJs.");
console.log(ex);
}
});
</script>
</body>
</html>

View File

@ -0,0 +1,22 @@
{ "id": "coin_info",
"name": "Crypto-Coins Info",
"shortName":"Coins Info",
"version": "0.01",
"description": "Crypto-Coins Infos with the help of the Coinmarketcap API",
"icon": "app.png",
"type": "bootloader",
"tags": "blockchain,crypto,cryptocurrency",
"supports" : ["BANGLEJS2"],
"interface": "interface.html",
"readme": "README.md",
"data": [
{"name":"coin_info.settings.json"},
{"name":"coin_info.cmc_key.json"}
],
"storage": [
{"name":"owmweather.default.json","url":"default.json"},
{"name":"owmweather.boot.js","url":"boot.js"},
{"name":"owmweather","url":"lib.js"},
{"name":"owmweather.settings.js","url":"settings.js"}
]
}