sports bug fixes
This commit is contained in:
parent
eedb40ac32
commit
1a4ed74c38
@ -299,9 +299,9 @@ def updateCurrencies(api_key):
|
|||||||
|
|
||||||
|
|
||||||
def updateSports(api_key):
|
def updateSports(api_key):
|
||||||
url = 'https://www.thesportsdb.com/api/v1/json/1/lookuptable.php?l=4328&s=2020-2021' # premier league table
|
url = 'https://www.thesportsdb.com/api/v1/json/{}/lookuptable.php?l=4328&s=2020-2021'.format(api_key) # premier league table
|
||||||
'https://www.thesportsdb.com/api/v1/json/1/eventsnext.php?id=133602' # next five events by team ID (paid) use this for upcoming team games
|
'https://www.thesportsdb.com/api/v1/json/{}/eventsnext.php?id=133602'.format(api_key) # next five events by team ID (paid) use this for upcoming team games
|
||||||
'https://www.thesportsdb.com/api/v2/json/APIKEY/livescore.php?l=4380' #live scores
|
|
||||||
|
|
||||||
r = requests.get(url)
|
r = requests.get(url)
|
||||||
all_data = r.json()
|
all_data = r.json()
|
||||||
@ -326,7 +326,11 @@ def updateSports(api_key):
|
|||||||
json.dump(premier_teams, open( "csv/sports/premier_league/team_stats.json", 'w+' ))
|
json.dump(premier_teams, open( "csv/sports/premier_league/team_stats.json", 'w+' ))
|
||||||
|
|
||||||
|
|
||||||
url = 'https://www.thesportsdb.com/api/v1/json/1/eventsseason.php?id=4328&s=2020-2021' # all events in premier league
|
#url = 'https://www.thesportsdb.com/api/v1/json/{}/eventsseason.php?id=4328&s=2020-2021'.format(api_key) # all past events in premier league
|
||||||
|
|
||||||
|
url ='https://www.thesportsdb.com/api/v1/json/{}/eventspastleague.php?id=4328'.format(api_key) #last 15 events on the league (premium only)
|
||||||
|
|
||||||
|
print(url)
|
||||||
r = requests.get(url)
|
r = requests.get(url)
|
||||||
all_data = r.json()
|
all_data = r.json()
|
||||||
|
|
||||||
@ -336,9 +340,10 @@ def updateSports(api_key):
|
|||||||
|
|
||||||
events = []
|
events = []
|
||||||
|
|
||||||
for i in range(len(all_data['events'][i])):
|
for i in range(len(all_data['events'])):
|
||||||
event = {}
|
event = {}
|
||||||
event['date'] = all_data['events'][i]['dateEvent']
|
event['date'] = all_data['events'][i]['dateEvent']
|
||||||
|
print(event['date'])
|
||||||
event['time'] = all_data['events'][i]['strTime']
|
event['time'] = all_data['events'][i]['strTime']
|
||||||
event['home_team'] = all_data['events'][i]['strHomeTeam']
|
event['home_team'] = all_data['events'][i]['strHomeTeam']
|
||||||
event['home_score'] = all_data['events'][i]['intHomeScore']
|
event['home_score'] = all_data['events'][i]['intHomeScore']
|
||||||
@ -350,8 +355,13 @@ def updateSports(api_key):
|
|||||||
|
|
||||||
json.dump(events, open( "csv/sports/premier_league/past_games.json", 'w+' ))
|
json.dump(events, open( "csv/sports/premier_league/past_games.json", 'w+' ))
|
||||||
|
|
||||||
url ='https://www.thesportsdb.com/api/v1/json/1/eventsnextleague.php?id=4328' #next 15 events on the league (premium only)
|
|
||||||
|
|
||||||
|
url ='https://www.thesportsdb.com/api/v1/json/{}/eventsnextleague.php?id=4328'.format(api_key) #next 15 events on the league (premium only)
|
||||||
|
|
||||||
|
url = 'https://www.thesportsdb.com/api/v2/json/{}/livescore.php?l=4380'.format(api_key) #live scores
|
||||||
|
print(all_data)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -399,6 +409,9 @@ if __name__ == '__main__':
|
|||||||
currency_key = '862dbb6d1101ce0c5136'
|
currency_key = '862dbb6d1101ce0c5136'
|
||||||
sports_key = '97436974'
|
sports_key = '97436974'
|
||||||
|
|
||||||
|
updateSports(sports_key)
|
||||||
|
sys.exit()
|
||||||
|
|
||||||
updateCurrencies(currency_key)
|
updateCurrencies(currency_key)
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
symbol,name,base,current,24hr change
|
symbol,name,base,current,24hr change
|
||||||
BTC,bitcoin,usd,41446,3.248036397011369
|
BTC,bitcoin,usd,39051,-4.251547889353901
|
||||||
ETH,ethereum,gbp,1853.43,1.422507551227988
|
ETH,ethereum,gbp,1717.96,-6.393401847745126
|
||||||
|
|
@ -1 +1 @@
|
|||||||
["USD", {"AUD": [1.3001, 1.2959], "CAD": [1.2189, 1.2167], "CHF": [0.90015, 0.89903], "EUR": [0.8259, 0.82563], "GBP": [0.71151, 0.7092], "JPY": [110.08, 109.77], "NZD": [1.403, 1.4002]}]
|
["USD", {"AUD": [1.2965, 1.3001], "CAD": [1.2177, 1.2189], "CHF": [0.89871, 0.90015], "EUR": [0.82481, 0.8259], "GBP": [0.70793, 0.71151], "JPY": [109.86, 110.08], "NZD": [1.3981, 1.403]}]
|
@ -1 +1 @@
|
|||||||
{"main_weather": "Clouds", "description": "overcast clouds", "temp": 29.6, "min_temp": 28.91, "max_temp": 30.21, "feels_like": 35.96, "humidity": 78, "clouds": 100, "wind_speed": 0.45, "wind_direction": 332, "visibility": 10000, "uv": 0, "rain_chance": 0.49}
|
{"main_weather": "Clouds", "description": "overcast clouds", "temp": 29.83, "min_temp": 28.91, "max_temp": 30.21, "feels_like": 36.83, "humidity": 79, "clouds": 100, "wind_speed": 0.45, "wind_direction": 27, "visibility": 10000, "uv": 0, "rain_chance": 0.63}
|
@ -1 +1 @@
|
|||||||
[{"main_weather": "Rain", "description": "light rain", "min_temp": 28.77, "max_temp": 30.09}, {"main_weather": "Rain", "description": "moderate rain", "min_temp": 28.25, "max_temp": 30.18}, {"main_weather": "Rain", "description": "moderate rain", "min_temp": 28.38, "max_temp": 30.34}, {"main_weather": "Rain", "description": "light rain", "min_temp": 28.71, "max_temp": 30.54}, {"main_weather": "Rain", "description": "light rain", "min_temp": 28.64, "max_temp": 30.36}, {"main_weather": "Rain", "description": "light rain", "min_temp": 28.8, "max_temp": 30.44}, {"main_weather": "Rain", "description": "moderate rain", "min_temp": 27.04, "max_temp": 29.26}, {"main_weather": "Rain", "description": "moderate rain", "min_temp": 26.78, "max_temp": 27.71}]
|
[{"main_weather": "Rain", "description": "moderate rain", "min_temp": 28.39, "max_temp": 29.91}, {"main_weather": "Rain", "description": "light rain", "min_temp": 28.62, "max_temp": 30.31}, {"main_weather": "Rain", "description": "light rain", "min_temp": 28.85, "max_temp": 30.66}, {"main_weather": "Rain", "description": "light rain", "min_temp": 28.45, "max_temp": 30.88}, {"main_weather": "Rain", "description": "light rain", "min_temp": 28.72, "max_temp": 30.97}, {"main_weather": "Rain", "description": "moderate rain", "min_temp": 26.93, "max_temp": 29.19}, {"main_weather": "Rain", "description": "moderate rain", "min_temp": 26.54, "max_temp": 28.14}, {"main_weather": "Rain", "description": "moderate rain", "min_temp": 26.46, "max_temp": 27.82}]
|
@ -1 +1 @@
|
|||||||
15/06/2021 14:34:09
|
16/06/2021 14:19:52
|
||||||
|
|
40
csv/news.csv
40
csv/news.csv
@ -1,21 +1,21 @@
|
|||||||
headline,source,date,time
|
headline,source,date,time
|
||||||
Hungary vs Portugal LIVE: Euro 2020 latest score^ goals and updates from fixture today - The Independent,Independent,2021-06-15,16:37:47Z
|
US scientists develop coating to capture airborne droplets - The Straits Times,The Straits Times,2021-06-16,16:36:07Z
|
||||||
Smash Bros Ultimate DLC reveal: Tekken's Kazuya revealed as next Fighters Pass 2 brawler - Express,Express,2021-06-15,16:32:33Z
|
Royal Ascot 2021^ day two: Love wins Prince of Wales Stakes – live! - The Guardian,The Guardian,2021-06-16,16:34:37Z
|
||||||
Duterte retains GCQ with restrictions in NCR Plus - The Manila Times,The Manila Times,2021-06-15,16:30:00Z
|
Turkey vs Wales^ Euro 2020 live: score and latest updates from Group A - The Telegraph,Telegraph.co.uk,2021-06-16,16:29:01Z
|
||||||
Noul sistem de operare mobil pentru care 4 milioane de dezvoltatori dezvolta aplicatii - Dojotech.ro,Dojotech.ro,2021-06-15,16:23:19Z
|
European Union to recommend lifting travel restrictions on American tourists - USA TODAY,USA Today,2021-06-16,16:18:45Z
|
||||||
SC orders Disini: Pay government ₧1 billion in damages for $2.2-billion nuke plant | Joel R. San Juan - Business Mirror,Businessmirror.com.ph,2021-06-15,16:14:00Z
|
PH rep to UNHRC did not consult gov’t on vote to probe Israel over Gaza abuses – Duterte - INQUIRER.net,Inquirer.net,2021-06-16,16:17:00Z
|
||||||
MP Yasmin Ratansi put herself in conflict of interest by employing foster sister: ethics commissioner - CBC.ca,CBC News,2021-06-15,16:13:03Z
|
IMF cuts PHL growth projection to 5.4% | Bianca Cuaresma - Business Mirror,Businessmirror.com.ph,2021-06-16,16:16:00Z
|
||||||
Chicago mass shooting: 8 shot^ 4 fatally^ in Englewood home - Chicago Sun-Times,Suntimes.com,2021-06-15,16:10:07Z
|
Skeletal remains recovered from Crosshaven identified as Barry Coughlan - Irish Examiner,Irish Examiner,2021-06-16,16:14:00Z
|
||||||
China^ Its Military Might Expanding^ Accuses NATO of Hypocrisy - The New York Times,New York Times,2021-06-15,16:09:49Z
|
Baba Ijesha: Magistrate court rule for Nollywood actor Olarenwaju James to remain for detention till July 13 - BBC News,BBC News,2021-06-16,16:13:46Z
|
||||||
US retail sales fell in May; UK jobless rate drops and payrolls rise – business live - The Guardian,The Guardian,2021-06-15,16:07:54Z
|
Over-the-counter fungicide holds potential to disrupt steroid hormone levels - News-Medical.Net,News-Medical.Net,2021-06-16,16:12:00Z
|
||||||
Beats Studio Buds vs Apple AirPods Pro: the noise-cancelling earbuds compared - TechRadar,TechRadar,2021-06-15,16:06:16Z
|
How to enable Google's unified Gmail interface - TechRepublic,TechRepublic,2021-06-16,16:07:49Z
|
||||||
India vs Afghanistan^ Highlights^ FIFA World Cup 2022 Qualifiers: India held to 1-1 draw - Firstpost,Firstpost,2021-06-15,16:02:53Z
|
New computational topology strategy to identify existing medicines for treating COVID-19 - News-Medical.net,News-Medical.Net,2021-06-16,16:07:00Z
|
||||||
Cicadas that come out every 17 years may emerge more often in the future - Science Magazine,Science Magazine,2021-06-15,16:00:00Z
|
JBL releases new headphones^ earphones for every lifestyle - BusinessWorld Online,BusinessWorld Online,2021-06-16,16:03:16Z
|
||||||
Converge investing P1 billion for new data center - Philstar.com,Philippine Star,2021-06-15,16:00:00Z
|
Lina Khan^ Big Tech skeptic^ named FTC chair mere hours after confirmation - Ars Technica,Ars Technica,2021-06-16,16:01:57Z
|
||||||
Garland announces national strategy to combat domestic terrorism^ invoking US Capitol riot - CNN ,CNN,2021-06-15,15:55:00Z
|
PHL is polio free again^ thanks to mass inoculation drive | Claudeth Mocon-Ciriaco - Business Mirror,Businessmirror.com.ph,2021-06-16,16:01:00Z
|
||||||
Average Canadian house price up 38% compared to last year^ but down from March - CBC.ca,CBC News,2021-06-15,15:48:45Z
|
'Confident' A5 residents line up early for COVID-19 vaccination in Manila - GMA News,GMA News,2021-06-16,16:00:52Z
|
||||||
'Pure insanity': Emails detail Trump's pressure on Justice Department to overturn election - NBC News,NBC News,2021-06-15,15:48:26Z
|
Connecticut confirms 2 Powassan virus infections: What to know about tick-borne illness - Fox News,Fox News,2021-06-16,16:00:35Z
|
||||||
UW astronomer redefines the scientific hero as part of The Great Courses - UW News,UW News,2021-06-15,15:46:44Z
|
Ghislaine Maxwell subjected to raw sewage in New York jail^ lawyer says - The Guardian,The Guardian,2021-06-16,16:00:00Z
|
||||||
Gone Girl actor Lisa Banes dies 10 days after hit-and-run - Independent.ie,Independent.ie,2021-06-15,15:44:00Z
|
Putin and Biden end summit^ schedule separate news conferences - The Straits Times,The Straits Times,2021-06-16,15:59:18Z
|
||||||
Electrons can form a strange 2-D 'Flatland' in a superconductor - Games Bollyinside - BollyInside,Bollyinside.com,2021-06-15,15:43:49Z
|
Putin and Biden end summit after less than 4 hours of talks - Rappler,Rappler,2021-06-16,15:57:00Z
|
||||||
BREAKING | There are no babies^ admits father of ‘Tembisa 10’ - News24,News24,2021-06-15,15:41:38Z
|
Driver has 'heart attack' at the wheel and crashes into cars near school - Liverpool Echo,Liverpool Echo,2021-06-16,15:53:52Z
|
||||||
|
|
@ -1,2 +1,2 @@
|
|||||||
speed,brightness
|
speed,brightness
|
||||||
s,9
|
f,9
|
|
File diff suppressed because one or more lines are too long
@ -1,4 +1,4 @@
|
|||||||
name,current,opening
|
name,current,opening
|
||||||
MSFT,258.05,259.775
|
MSFT,254.9199,259.4
|
||||||
NFLX,492.27,501.23
|
NFLX,486.83,495
|
||||||
GOOG,2519.23,2530.44
|
GOOG,2494.04,2524.95
|
||||||
|
|
BIN
league.ppm
BIN
league.ppm
Binary file not shown.
Loading…
Reference in New Issue
Block a user