-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathserver.py
More file actions
44 lines (37 loc) · 975 Bytes
/
server.py
File metadata and controls
44 lines (37 loc) · 975 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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
from flask import Flask, jsonify, request
import requests
import json
import sys
from bs4 import BeautifulSoup
from cricbuzz import Cricbuzz
from flask import Response
from json2html import *
app = Flask(__name__)
@app.route('/getMatches')
def getMatches():
c = Cricbuzz()
list = c.matches()
return json2html.convert(json=list)
@app.route('/livescore')
def getMatchInfo():
matchId = request.args.get('matchId')
c = Cricbuzz()
list = c.livescore(matchId)
return json2html.convert(json=list)
@app.route('/scorecard')
def scorecard():
matchId = request.args.get('matchId')
c = Cricbuzz()
list = c.scorecard(matchId)
return json2html.convert(json=list)
@app.route('/commentary')
def commentary():
matchId = request.args.get('matchId')
c = Cricbuzz()
list = c.commentary(matchId)
return json2html.convert(json=list)
if __name__ == '__main__':
app.run(
host="0.0.0.0",
port=int("1234")
)