Removed CoinMarketCap feature

This commit is contained in:
Abhorrent_Anger 2020-05-08 20:04:55 +03:00
parent 551e8f509c
commit 06be6ab921
4 changed files with 4 additions and 105 deletions

View File

@ -1,5 +1,5 @@
# VertiBar Start Page
Minimal self-contained speed dial for use on cloud-based storage across multiple devices. Fully configurable through variables and JSON arrays. Supports link sorting and cryptocurrency tickers with [CoinMarketCap](https://coinmarketcap.com/) API price updates.
Minimal self-contained speed dial for use on cloud-based storage across multiple devices. Fully configurable through variables and JSON arrays. Supports link sorting.
## Usage
Drop it wherever, point your browser to it as a New Tab.
## Configuration
@ -7,4 +7,4 @@ Set the variables inside the **<script>** tag (See comments or examples fo
## Examples
![Basic full example](examples/basic_example.png)
## Notes
As of yet, [CoinMarketCap](https://coinmarketcap.com/) API calls aren't limited, nor cached. jQuery library used for animations and basic processing should be cached by your browser.
jQuery library used for animations and basic processing should be cached by your browser.

View File

@ -7,14 +7,6 @@
var sortSubcategories = true; // Sort URLs alphabetically
var singleExpand = true; // Allow expanding one category at a time
var rounding = 8; // Cryptocurrency rounding to n-th digit
var cryptos = // List of cryptos (their IDs on CoinMarketCap) and respective values
{
'bitcoin' : 0.12345678,
'ethereum' : 0.12345678,
'monero' : 0.12345678,
};
var sites = // JSON tree structure of 'Group' : { 'Name' : 'URL' }
{
'Shopping' :
@ -76,18 +68,6 @@
transform: translateY(-50%);
display: none;
}
#cryptoTicker {
position: fixed;
bottom: 0;
right: 0;
display: none;
}
#cryptoTable td {
padding: 0px 15px;
text-align: center;
font-family: "Lucida Console", Monaco, monospace;
font-size: 0.6em;
}
</style>
<script src="http://code.jquery.com/jquery-3.2.1.min.js"></script> <!-- Gets cached, can be replaced with Google hosted library -->
<script>
@ -122,44 +102,12 @@
$('.expandLink').siblings().slideUp(); // "Closes" all categories
$(this).siblings().slideToggle(200);
});
// Ticker table (Async)
var usdtotal = 0.0;
jQuery.each(cryptos, function(key, value) {
$.ajax({
url: "https://api.coinmarketcap.com/v1/ticker/"+key+"/",
async: false,
cache: true,
success: function(data) {
usdtotal += usdval = (value*parseFloat(data[0].price_usd));
$('#cryptoTable tr:last').after(
'<tr><td>'+
data[0].rank+
'</td><td><a href="https://coinmarketcap.com/currencies/'+key+'/">'+
data[0].symbol+
'</a></td><td>'+
value.toFixed(rounding)+
'</td><td>'+
parseFloat(data[0].price_usd).toFixed(2)+
'</td><td>'+
usdval.toFixed(2)+
'</tr></tr>');
}
});
});
$('#cryptoTable tr:last').after('<tr><td></td><td></td><td></td><td></td><td>'+usdtotal.toFixed(2)+'</td></tr>')
$("#cryptoTicker").fadeIn();
});
</script>
<meta name="Abhorrent_Anger" content="Speed Dail">
<meta name="Abhorrent_Anger" content="Speed Dial">
<meta http-equiv="Cache-control" content="public">
</head>
<body bgcolor="#151515">
<div id="cryptoTicker">
<table id="cryptoTable">
<tr><td>Rank</td><td>Ticker</td><td>Hold</td><td>USD</td><td>Hold USD</td></tr>
</table>
</div>
<div id="mainNav">
</div>
</body>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View File

@ -7,11 +7,6 @@
var sortSubcategories = true; // Sort URLs alphabetically
var singleExpand = true; // Allow expanding one category at a time
var rounding = 8; // Cryptocurrency rounding to n-th digit
var cryptos = // List of cryptos (their IDs on CoinMarketCap) and respective values
{
};
var sites = // JSON tree structure of 'Group' : { 'Name' : 'URL' }
{
};
@ -55,18 +50,6 @@
transform: translateY(-50%);
display: none;
}
#cryptoTicker {
position: fixed;
bottom: 0;
right: 0;
display: none;
}
#cryptoTable td {
padding: 0px 15px;
text-align: center;
font-family: "Lucida Console", Monaco, monospace;
font-size: 0.6em;
}
</style>
<script src="http://code.jquery.com/jquery-3.2.1.min.js"></script> <!-- Gets cached, can be replaced with Google hosted library -->
<script>
@ -101,44 +84,12 @@
$('.expandLink').siblings().slideUp(); // "Closes" all categories
$(this).siblings().slideToggle(200);
});
// Ticker table (Async)
var usdtotal = 0.0;
jQuery.each(cryptos, function(key, value) {
$.ajax({
url: "https://api.coinmarketcap.com/v1/ticker/"+key+"/",
async: false,
cache: true,
success: function(data) {
usdtotal += usdval = (value*parseFloat(data[0].price_usd));
$('#cryptoTable tr:last').after(
'<tr><td>'+
data[0].rank+
'</td><td><a href="https://coinmarketcap.com/currencies/'+key+'/">'+
data[0].symbol+
'</a></td><td>'+
value.toFixed(rounding)+
'</td><td>'+
parseFloat(data[0].price_usd).toFixed(2)+
'</td><td>'+
usdval.toFixed(2)+
'</tr></tr>');
}
});
});
$('#cryptoTable tr:last').after('<tr><td></td><td></td><td></td><td></td><td>'+usdtotal.toFixed(2)+'</td></tr>')
$("#cryptoTicker").fadeIn();
});
</script>
<meta name="Abhorrent_Anger" content="Speed Dail">
<meta name="Abhorrent_Anger" content="Speed Dial">
<meta http-equiv="Cache-control" content="public">
</head>
<body bgcolor="#151515">
<div id="cryptoTicker">
<table id="cryptoTable">
<tr><td>Rank</td><td>Ticker</td><td>Hold</td><td>USD</td><td>Hold USD</td></tr>
</table>
</div>
<div id="mainNav">
</div>
</body>