From 69555d5ad9f4f56c3eddba9a1874bae8bd468dfd Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Fri, 15 Jan 2016 14:57:48 -0200 Subject: [PATCH] Added two of the biggest brazilian exchangers, "Bitcontoyou" and "MercadoBitcoin", to Exchange rates plugin. --- plugins/exchange_rate/exchange_rate.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/plugins/exchange_rate/exchange_rate.py b/plugins/exchange_rate/exchange_rate.py index 7430e864..b8ebab01 100644 --- a/plugins/exchange_rate/exchange_rate.py +++ b/plugins/exchange_rate/exchange_rate.py @@ -250,6 +250,23 @@ class Winkdex(ExchangeBase): return dict([(h['timestamp'][:10], h['price'] / 100.0) for h in history]) +class MercadoBitcoin(ExchangeBase): + def get_rates(self,ccy): + json = self.get_json('mercadobitcoin.net', + "/api/ticker/ticker_bitcoin") + return {'BRL': Decimal(json['ticker']['last'])} + + def history_ccys(self): + return ['BRL'] + +class Bitcointoyou(ExchangeBase): + def get_rates(self,ccy): + json = self.get_json('bitcointoyou.com', + "/API/ticker.aspx") + return {'BRL': Decimal(json['ticker']['last'])} + + def history_ccys(self): + return ['BRL'] class FxPlugin(BasePlugin, ThreadJob):