Show estimated earning rates on html page
I tried submitting a pull request for this but couldn't get the github commandline client working. Anyway, you can view my implementation here: http://fornax96.me/lendingbot.html. Feel free to use. It currently only shows BTC rates, but I guess you could add a loop to support others too.
I also modified the lendingbot.py script to show one more decimal so it's more accurate.
Very interested in this.
I second this, would you mind sharing the code?
It's in the source of the page I added to the OP: view-source:http://fornax96.me/lendingbot.html
Basically what I did was write this function:
function updateRates(data){
console.log(/(\d+\.\d+) BTC/i.exec(data));
var btc = /(\d+\.\d+) BTC/i.exec(data)[1];
var percent = /BTC @ (\d+.\d+)\%/i.exec(data)[1];
var rate = +percent / 100;
var btchourly = (+btc * +rate) / 24;
var btcdaily = (+btc * +rate);
var btcweekly = (+btc * +rate) * 7;
var btcmonthly = (+btc * +rate) * 30;
var text = (Math.round(btcmonthly * 100000000) / 100000000) + " BTC per Month<br/>"
+ (Math.round(btcweekly * 100000000) / 100000000) + " BTC per Week<br/>"
+ (Math.round(btcdaily * 100000000) / 100000000) + " BTC per Day<br/>"
+ Math.round(btchourly * 100000000) + " Satoshi per Hour<br/>";
$("#rate").html(text);
}
which gets called in updateJson after updating the last_update text like this:
updateRates(data.last_status);
And I added a table row to show the information:
<tr><th class="col-xs-2" style="vertical-align: text-top;">BTC Rate</th><th class="col-xs-10" id="rate">N/A</th></tr>
Github's markdown code highlighting is not too well, I'll just try committing again
Can u add the other coins pls for us non coders
Sure, I'll work on it a bit more and add it to this repo. It may not be done before Saturday.
So far I see btc , Xmr , maid , Eth , and doge user mostly , have not heard any other coins yet
This is excellent, thank you.
how to use where are the files
m33Lucky: open http://fornax96.me/lendingbot.html in your browser save locally rename to lendingbot.html
in www folder remove original lendingbot.html copy/move new downloaded lendingbot.html into www folder restart lendingbot.py
Easy as pie, you don't even need to restart your bot
You also don't need to name it the same... as the logging is done in the json file you can have different html files interpreting it.
not working class not specified and cant get json
For anyone having an issue extracting the source: https://gist.github.com/Evanito/ca7281340a6171402c6f0855073e78a9#file-lendingbot-html
Hi,
I've used Fornax96's html file and it works good. I have a little different implantation of this feature and my calculations are about 15% lower. I suppose that those calculations are gross, before reducing the exchange fees.
I would suggest to change it to the net values, as those are the numbers we are interested in.
@Kili4ka Yep, lending fees are actually 15%
Added the 15% fee deduction. I'm now patching my own fork. It involves a lot of spacebar mashing.
Thanks. works as expected.
check at https://github.com/Mikadily/poloniexlendingbot/pull/58 for update and display all currencies
Closed by #58