fixed ltc balance with price

This commit is contained in:
kAmMa 2024-10-08 15:59:58 +02:00
parent 05045cc37e
commit f49d0b1dbd

View File

@ -109,10 +109,10 @@ public class MiningBean {
try { try {
if (ltcWallet != null && !"null".equals(ltcWallet) && ltcWallet.length() > 0) { if (ltcWallet != null && !"null".equals(ltcWallet) && ltcWallet.length() > 0) {
restRequest = getStringResponse( restRequest = getStringResponse(
"https://live.blockcypher.com/ltc/address/".concat(ltcWallet)); "https://litecoinblockexplorer.net/address/".concat(ltcWallet));
if (restRequest != null && restRequest.length() > 0 && restRequest.contains("<span class=\"dash-label\">Balance</span>")) { if (restRequest != null && restRequest.length() > 0 && restRequest.contains("Final Balance</p><p class=\"title is-5\">")) {
int index = restRequest.indexOf("<span class=\"dash-label\">Balance</span>")+"<span class=\"dash-label\">Balance</span>".length(); int index = restRequest.indexOf("Final Balance</p><p class=\"title is-5\">")+"Final Balance</p><p class=\"title is-5\">".length();
String text = restRequest.substring(index+4, index+15); String text = restRequest.substring(index, index+11);
double res = Double.parseDouble(text); double res = Double.parseDouble(text);
if (res > 0d) { if (res > 0d) {