-
Notifications
You must be signed in to change notification settings - Fork 12
/
server.py
43 lines (36 loc) · 1.04 KB
/
server.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
from flask import Flask, jsonify, request
import requests
import json
import sys
from bs4 import BeautifulSoup
from cricbuzz import Cricbuzz
from flask import Response
app = Flask(__name__)
@app.route('/getMatches')
def getMatches():
c = Cricbuzz()
list = c.matches()
return Response(json.dumps(list), mimetype='application/json')
@app.route('/livescore')
def getMatchInfo():
matchId = request.args.get('matchId')
c = Cricbuzz()
list = c.livescore(matchId)
return Response(json.dumps(list), mimetype='application/json')
@app.route('/scorecard')
def scorecard():
matchId = request.args.get('matchId')
c = Cricbuzz()
list = c.scorecard(matchId)
return Response(json.dumps(list), mimetype='application/json')
@app.route('/commentary')
def commentary():
matchId = request.args.get('matchId')
c = Cricbuzz()
list = c.commentary(matchId)
return Response(json.dumps(list), mimetype='application/json')
if __name__ == '__main__':
app.run(
host="0.0.0.0",
port=int("1234")
)