-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathweb.py
More file actions
26 lines (23 loc) · 841 Bytes
/
web.py
File metadata and controls
26 lines (23 loc) · 841 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
from slip_converter.converter import CodeConverter
from slip_converter.bookmakers.betking import Betking
from slip_converter.bookmakers.bet9ja import Bet9ja
# from slip_converter.bookmakers.sportybet import Sportybet
from flask import Flask, render_template, request, json
gamble = Flask(__name__, static_url_path='')
@gamble.route("/", methods=['GET'])
def index():
return render_template('index.html')
@gamble.route('/', methods=['POST'])
def api_convert():
bookmaker = {
"Bet9ja":Bet9ja,
"Betking":Betking,
}
code = request.form['code'];
from_ = request.form['from'];
to_ = request.form['to'];
conv = CodeConverter(code,bookmaker.get(from_),bookmaker.get(to_)())
conv.convert()
return json.dumps({'status':'OK','code':conv.getNewCode()});
if __name__ == "__main__":
gamble.run()