Skip to content

Commit

Permalink
Add usd and eur rbk plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
artyl committed Jun 3, 2020
1 parent 69ef016 commit 54cc052
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
18 changes: 18 additions & 0 deletions plugin/eur.py
Original file line number Diff line number Diff line change
@@ -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')
18 changes: 18 additions & 0 deletions plugin/usd.py
Original file line number Diff line number Diff line change
@@ -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')

0 comments on commit 54cc052

Please sign in to comment.