forked from adersonjunior85/Raspador-Betway
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flask_init.py
42 lines (33 loc) · 1.16 KB
/
flask_init.py
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
from raspadorBetway import *
from executeRaspador import *
from flask import Flask, jsonify, request
from bs4 import BeautifulSoup
from urllib.request import urlopen, Request
import os
app = Flask(__name__)
@app.route('/api/', methods=['GET'])
def teste():
return "Correto"
@app.route('/api/rasparTodosJogos/<string:esporte>', methods=['GET'])
def callFunction_rasparTodosJogos(esporte):
data = rasparTodosJogos(esporte)
return jsonify(data)
@app.route('/api/rasparLigas/<string:esporte>/<string:liga>', methods=['GET'])
def callFunction_(esporte, liga):
data = rasparLigas(esporte,liga)
return jsonify(data)
@app.route('/api/lerTodasOddsPorLiga/<string:esporte>/<string:liga>', methods=['GET'])
def callFunction_lerTodasOddsPorLiga(esporte, liga):
data = lerTodasOddsPorLiga(esporte,liga)
return jsonify(data)
@app.route('/api/capturaEsportes', methods=['GET'])
def callFunction_capturaEsportes():
data = capturaEsportes()
return jsonify(data)
@app.route('/api/leraovivo', methods=['GET'])
def callFunction_lerAovivo():
data = lerAovivo()
return jsonify(data)
if __name__ == '__main__':
port = int(os.environ.get('PORT', 5000))
app.run(host='0.0.0.0', port=port)