From 54cc052880bf7341d7301ae4ad8192c1fd314b09 Mon Sep 17 00:00:00 2001 From: Artem Lavrenov Date: Wed, 3 Jun 2020 12:50:57 +0300 Subject: [PATCH] Add usd and eur rbk plugin --- plugin/eur.py | 18 ++++++++++++++++++ plugin/usd.py | 18 ++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 plugin/eur.py create mode 100644 plugin/usd.py diff --git a/plugin/eur.py b/plugin/eur.py new file mode 100644 index 0000000..8497679 --- /dev/null +++ b/plugin/eur.py @@ -0,0 +1,18 @@ +# -*- coding: utf8 -*- +import sys;sys.dont_write_bytecode = True +import os, sys, re, time, logging +import requests +import store + +def get_balance(login, password, storename=None): + result = {} + session = requests.Session() + url = time.strftime("http://cbrates.rbc.ru/tsv/978/%Y/%m/%d.tsv") + response2 = session.get(url) + result['Balance'] = response2.text.split()[-1] + result['userName'] = 'Курс евро от РБК' + return result + + +if __name__ == '__main__': + print('This is module EUR') diff --git a/plugin/usd.py b/plugin/usd.py new file mode 100644 index 0000000..72f22ab --- /dev/null +++ b/plugin/usd.py @@ -0,0 +1,18 @@ +# -*- coding: utf8 -*- +import sys;sys.dont_write_bytecode = True +import os, sys, re, time, logging +import requests +import store + +def get_balance(login, password, storename=None): + result = {} + session = requests.Session() + url = time.strftime("http://cbrates.rbc.ru/tsv/840/%Y/%m/%d.tsv") + response2 = session.get(url) + result['Balance'] = response2.text.split()[-1] + result['userName'] = 'Курс доллара от РБК' + return result + + +if __name__ == '__main__': + print('This is module USD')