-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsports_data2.py
More file actions
57 lines (42 loc) · 1.67 KB
/
sports_data2.py
File metadata and controls
57 lines (42 loc) · 1.67 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
"""
====================================================================
Copyright (c) 2018-2019 Smasher Solutions, Inc.
ALL RIGHTS RESERVED.
C O N F I D E N T I A L I N F O R M A T I O N
This file contains confidential, proprietary and unpublished
source code solely owned by Smasher Media Solutions, Inc.
sports_data.py - gets all Sporting Events for today
Scrapes data from the api from : api.sportradar.us
nfl - Current NFL data
nba - Current NBA data
more - all others to do
Relace the above info for the sports data
http://api.sportradar.us/football-t1/american/en/schedules/2018-01-14/results.json?api_key=6ps4fbsxgmqbapmcs687vsmz
http://api.sportradar.us/football-t1/american/en/shedules/2018-01-14/results.json?api_key=6ps4fbsxgmqbapmcs687vsmz
====================================================================
"""
import requests
import json
SPORTRADAR_URL = "http://api.sportradar.us"
API_KEY = "6ps4fbsxgmqbapmcs687vsmz"
SPORT = "football-t1/american/"
LANG = 'en'
WEEK = "2018-01-14"
'''
conn = http.client.HTTPSConnection("api.sportradar.us")
key = 'ymtkrbbkec6q2hcfqegv8mqc'
sport = "/nfl-ot2/stream/events/subscribe?"
# api_key={your_api_key}&status=inprogress&match=sd:match:673b459c-7506-4c11-9273-1b9502537f1d")
res = conn.getresponse()
data = res.read()
&status=inprogress&match=sd:match:673b459c-7506-4c11-9273-1b9502537f1d")
'''
sport = "/nfl-ot2/stream/events/subscribe"
cmd = SPORTRADAR_URL + '/' + SPORT + LANG + '/' + 'schedules/' + WEEK + '/results.json?api_key=' + API_KEY
print '\n' + cmd
#s = sign.capitalize() + ': '
r = requests.get(cmd)
h = r.text
print h
oj = json.dumps(r.json, indent=4)
print oj