MikaLendingBot icon indicating copy to clipboard operation
MikaLendingBot copied to clipboard

Alternative outputcurrency

Open Reno007 opened this issue 7 years ago • 15 comments

If I add EUR as an alternative output currency (instead of BTC) for the html log it does not work (and the bot applies BTC instead). Does this work for any of you guys?

Reno007 avatar Apr 28 '17 14:04 Reno007

Works fine for me :

screen shot 2017-04-28 at 4 29 29 pm

Is there anything in the log to stdout?

laxdog avatar Apr 28 '17 15:04 laxdog

Same here, my bot is in EUR. image

Try the following link: https://blockchain.info/tobtc?currency=EUR&value=1 This is the link the bot uses to get the EUR conversion rate, if it fails it will display BTC.

rnevet avatar Apr 28 '17 15:04 rnevet

capture1 capture2

Reno007 avatar Apr 28 '17 15:04 Reno007

Hmm, this is what I get...

Reno007 avatar Apr 28 '17 15:04 Reno007

Also, if you're running on pythonanywhere, it won't work. They block that address https://github.com/Mikadily/poloniexlendingbot/issues/262

laxdog avatar Apr 28 '17 15:04 laxdog

Ah that would be it....

Reno007 avatar Apr 28 '17 15:04 Reno007

Thanks!

Reno007 avatar Apr 28 '17 15:04 Reno007

We could actually move the entire output currency conversion to HTML Javascript side. @yura-pakhuchiy what do you think? exchange rates are anyway public APIs.

rnevet avatar Apr 28 '17 15:04 rnevet

Good idea, it could also be a drop down then.

laxdog avatar Apr 28 '17 15:04 laxdog

Yes, we can have BTC -> output currency conversion done in JS (allowing output currency switch in runtime). However, it is better to keep altcoin -> BTC rate in bot it self. Requesting every altcoin rate from JS will greatly increase time between json retrieval and moment when data can be displayed to user. Maybe even leave BTC->USDT rate in bot (for fastest default option), but move BTC -> EUR/real USD/others to JS (if user wants alternative currencies).

yura-pakhuchiy avatar Apr 28 '17 19:04 yura-pakhuchiy

That would be great! Thanks guys, awesome project

Reno007 avatar May 01 '17 09:05 Reno007

Can we close this and create another ticket for the work to come out of it if that's still happening @yura-pakhuchiy or @rnevet ?

laxdog avatar Aug 04 '17 08:08 laxdog

@AndreyIlinX can you elaborate on the solution in your branch?

rnevet avatar Aug 05 '17 19:08 rnevet

@rnevet Hello, in short, I use build_opener from urllib2 instead of using urlopen from urllib, and it works

AndreyIlinX avatar Aug 05 '17 22:08 AndreyIlinX

@AndreyIlinX Why not use that as the first call? Do you have any idea why this is working? I thought the issue was that PythonAnywhere blocks the api access.

rnevet avatar Aug 06 '17 11:08 rnevet