You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now that Apple has removed Python from the macOS 12.3 betas, it might make sense to switch the templates to use Java Script widgets - so no third party binaries are needed.
I'm opening this issue to discuss whether this makes sense :-)
I did a quick proof of concept script that seems to work fine, but it currently lacks any customization options apart from the coins and the currencies:
// BTT doesn't support top level await, thus needs to be wrapped in a self executing function(async()=>{constcoinsToLoad=["BTC"];constcurrenciesToLoad=["EUR"];asyncfunctionfetchCrypto(coins,currencies){constfsyms=coins.join(",");consttsyms=currencies.join(",");constcryptoCompareURL=`https://min-api.cryptocompare.com/data/pricemultifull?fsyms=${fsyms}&tsyms=${tsyms}`;constresponse=awaitfetch(cryptoCompareURL);constjson=awaitresponse.json();constcurrentPrices=[];for(constcurrencyofcurrencies){for(constcoinofcoins){currentPrices.push(json["RAW"][coin][currency]["PRICE"]+" "+currency);}}returncurrentPrices;}constresultPrices=awaitfetchCrypto(coinsToLoad,currenciesToLoad);returnToBTT(resultPrices.join(" | "));})();
I will add a readFile and writeFile function to the BTT Java Script runner, so the cache can also be implemented.
The text was updated successfully, but these errors were encountered:
Hey, appreciate the heads up - I had no idea that had been removed. To be honest seems like a good enough reason as any to remove the python dependency.
Just to be clear the JS runs inside BTT so a user wouldn't need any nodejs installed etc?
Is there any version/limitations/spec/comparison on what's allowed inside the JS inside BTT?
Now that Apple has removed Python from the macOS 12.3 betas, it might make sense to switch the templates to use Java Script widgets - so no third party binaries are needed.
I'm opening this issue to discuss whether this makes sense :-)
I did a quick proof of concept script that seems to work fine, but it currently lacks any customization options apart from the coins and the currencies:
I will add a readFile and writeFile function to the BTT Java Script runner, so the cache can also be implemented.
The text was updated successfully, but these errors were encountered: