commit
fc6b93efbe
@ -5,6 +5,8 @@
|
|||||||
# This code can not be copied and/or distributed without the express
|
# This code can not be copied and/or distributed without the express
|
||||||
# permission of Fintic
|
# permission of Fintic
|
||||||
|
|
||||||
|
import random
|
||||||
|
import pickle
|
||||||
import finnhub
|
import finnhub
|
||||||
import time
|
import time
|
||||||
import csv
|
import csv
|
||||||
@ -85,49 +87,37 @@ def updateUpdate(NY_time):
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
def updateStocks(api_key, logf):
|
# def updateStocks(api_key, logf):
|
||||||
|
# try:
|
||||||
|
# f = open('csv/stocks_settings.json', 'r')
|
||||||
try:
|
# all_stocks_settings = json.load(f)
|
||||||
|
# f.close()
|
||||||
|
# stock_info = all_stocks_settings['symbols']
|
||||||
max_stocks = 200
|
# symbols = list(stock_info.keys())
|
||||||
|
|
||||||
f = open('csv/stocks_settings.json', 'r')
|
|
||||||
all_stocks_settings = json.load(f)
|
|
||||||
f.close()
|
|
||||||
stock_info = all_stocks_settings['symbols']
|
|
||||||
symbols = list(stock_info.keys())
|
|
||||||
|
|
||||||
|
# url = 'https://bm7p954xoh.execute-api.us-east-2.amazonaws.com/default/ScriptsAPI/stocks?symbols='
|
||||||
url = 'https://bm7p954xoh.execute-api.us-east-2.amazonaws.com/default/ScriptsAPI/stocks?symbols='
|
|
||||||
|
|
||||||
for symbol in symbols:
|
# for symbol in symbols:
|
||||||
url += symbol + ','
|
# url += symbol + ','
|
||||||
|
|
||||||
url += '&apiKey=' + api_key
|
# url += '&apiKey=' + api_key
|
||||||
response = requests.get(url)
|
# response = requests.get(url)
|
||||||
data = response.json()
|
# data = response.json()
|
||||||
|
|
||||||
|
|
||||||
# stock_info = {}
|
|
||||||
if len(data) > 0:
|
|
||||||
for symbol in symbols:
|
|
||||||
for stock in data:
|
|
||||||
if stock['symbol'] == symbol:
|
|
||||||
stock_info[stock['symbol']] = {'current': stock['price'], 'change': stock['change_since'], 'percent_change':stock['percent']}
|
|
||||||
|
|
||||||
|
|
||||||
all_stocks_settings['symbols'] = stock_info
|
|
||||||
|
|
||||||
|
|
||||||
f = open('csv/stocks_settings.json', 'w+')
|
|
||||||
json.dump(all_stocks_settings, f)
|
|
||||||
f.close()
|
|
||||||
|
|
||||||
except:
|
# # stock_info = {}
|
||||||
pass
|
# if len(data) > 0:
|
||||||
|
# for symbol in symbols:
|
||||||
|
# for stock in data:
|
||||||
|
# if stock['symbol'] == symbol:
|
||||||
|
# stock_info[stock['symbol']] = {'current': stock['price'], 'change': stock['change_since'], 'percent_change':stock['percent']}
|
||||||
|
|
||||||
|
# all_stocks_settings['symbols'] = stock_info
|
||||||
|
# f = open('csv/stocks_settings.json', 'w+')
|
||||||
|
# json.dump(all_stocks_settings, f)
|
||||||
|
# f.close()
|
||||||
|
|
||||||
|
# except:
|
||||||
|
# pass
|
||||||
#logf = open('log.txt', "a")
|
#logf = open('log.txt', "a")
|
||||||
#exc_type, exc_obj, exc_tb = sys.exc_info()
|
#exc_type, exc_obj, exc_tb = sys.exc_info()
|
||||||
#fname = os.path.split(exc_tb.tb_frame.f_code.co_filename)[1]
|
#fname = os.path.split(exc_tb.tb_frame.f_code.co_filename)[1]
|
||||||
@ -139,10 +129,107 @@ def updateStocks(api_key, logf):
|
|||||||
#logf.close()
|
#logf.close()
|
||||||
|
|
||||||
|
|
||||||
def updateStocksPrePost(api_key, logf):
|
def getCookiesnCrumb():
|
||||||
|
|
||||||
|
headers = {'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7',
|
||||||
|
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36'}
|
||||||
|
cookie_url = 'https://finance.yahoo.com'
|
||||||
|
crumb_url = 'https://query1.finance.yahoo.com/v1/test/getcrumb'
|
||||||
|
|
||||||
|
session = requests.Session()
|
||||||
|
session.get(cookie_url, headers=headers)
|
||||||
|
crumb = session.get(crumb_url, headers=headers).content.decode('utf-8')
|
||||||
|
|
||||||
|
with open('session.txt', 'wb') as f:
|
||||||
|
pickle.dump(session, f)
|
||||||
|
with open('crumb.txt', 'w') as f:
|
||||||
|
f.write(crumb)
|
||||||
|
|
||||||
|
|
||||||
|
def updateStocks(api_key, logf):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
f = open('csv/stocks_settings.json', 'r')
|
||||||
|
all_stocks_settings = json.load(f)
|
||||||
|
f.close()
|
||||||
|
stock_info = all_stocks_settings['symbols']
|
||||||
|
symbols = list(stock_info.keys())
|
||||||
|
|
||||||
|
headers = {'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7',
|
||||||
|
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36'}
|
||||||
|
|
||||||
|
# url = 'https://bm7p954xoh.execute-api.us-east-2.amazonaws.com/default/ScriptsAPI/stocks?symbols='
|
||||||
|
url1 = 'https://query1.finance.yahoo.com/v7/finance/quote?fields=regularMarketPrice,regularMarketChangePercent,regularMarketChange®ion=US&lang=en-US&symbols='
|
||||||
|
url2 = 'https://cloud.iexapis.com/v1/stock/market/batch?&types=quote&token=pk_aff870df1a984daa9dd43c71801c1936&symbols='
|
||||||
|
url = random.choice([url1, url2])
|
||||||
|
|
||||||
|
for symbol in symbols:
|
||||||
|
url += symbol + ','
|
||||||
|
# url += '&apiKey=' + api_key
|
||||||
|
|
||||||
|
if 'cloud.iexapis.com' in url:
|
||||||
|
response = requests.get(url, headers=headers)
|
||||||
|
data = response.json()
|
||||||
|
if len(data) > 0:
|
||||||
|
for symbol in symbols:
|
||||||
|
stock_info[data[symbol]['quote']['symbol']] = {'current': data[symbol]['quote']['latestPrice'], 'change': data[symbol]['quote']['change'], 'percent_change':data[symbol]['quote']['changePercent'] * 100}
|
||||||
|
|
||||||
|
all_stocks_settings['symbols'] = stock_info
|
||||||
|
f = open('csv/stocks_settings.json', 'w+')
|
||||||
|
json.dump(all_stocks_settings, f)
|
||||||
|
f.close()
|
||||||
|
|
||||||
|
elif 'query1.finance.yahoo.com/v7' in url:
|
||||||
|
response = requests.get(url, headers=headers)
|
||||||
|
data = response.json()
|
||||||
|
if "'error': {'code'" in str(data):
|
||||||
|
while True:
|
||||||
|
try:
|
||||||
|
with open('session.txt', 'rb') as f:
|
||||||
|
session = pickle.load(f)
|
||||||
|
with open('crumb.txt', 'r') as f:
|
||||||
|
crumb = f.read()
|
||||||
|
except:
|
||||||
|
getCookiesnCrumb()
|
||||||
|
with open('session.txt', 'rb') as f:
|
||||||
|
session = pickle.load(f)
|
||||||
|
with open('crumb.txt', 'r') as f:
|
||||||
|
crumb = f.read()
|
||||||
|
params = {'crumb': crumb}
|
||||||
|
|
||||||
|
data = session.get(url, headers=headers, params=params).json()
|
||||||
|
|
||||||
|
if "'error': {'code'" not in str(data):
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
getCookiesnCrumb()
|
||||||
|
time.sleep(5)
|
||||||
|
# stock_info = {}
|
||||||
|
if len(data) > 0:
|
||||||
|
for symbol in symbols:
|
||||||
|
for stock in data['quoteResponse']['result']:
|
||||||
|
if stock['symbol'] == symbol:
|
||||||
|
stock_info[stock['symbol']] = {'current': stock['regularMarketPrice'], 'change': stock['regularMarketChange'], 'percent_change':stock['regularMarketChangePercent']}
|
||||||
|
|
||||||
|
all_stocks_settings['symbols'] = stock_info
|
||||||
|
f = open('csv/stocks_settings.json', 'w+')
|
||||||
|
json.dump(all_stocks_settings, f)
|
||||||
|
f.close()
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
#logf = open('log.txt', "a")
|
||||||
|
#exc_type, exc_obj, exc_tb = sys.exc_info()
|
||||||
|
#fname = os.path.split(exc_tb.tb_frame.f_code.co_filename)[1]
|
||||||
|
#logf.write(str(e))
|
||||||
|
#logf.write('. file: ' + fname)
|
||||||
|
#logf.write('. line: ' + str(exc_tb.tb_lineno))
|
||||||
|
#logf.write('. type: ' + str(exc_type))
|
||||||
|
#logf.write('\n ' + "".join(traceback.format_exception(sys.exc_info()[0], sys.exc_info()[1], sys.exc_info()[2])))
|
||||||
|
#logf.close()
|
||||||
|
|
||||||
|
|
||||||
|
def updateStocksPrePost(api_key, logf):
|
||||||
|
try:
|
||||||
f = open('csv/stocks_settings.json', 'r')
|
f = open('csv/stocks_settings.json', 'r')
|
||||||
all_stocks_settings = json.load(f)
|
all_stocks_settings = json.load(f)
|
||||||
f.close()
|
f.close()
|
||||||
@ -150,21 +237,40 @@ def updateStocksPrePost(api_key, logf):
|
|||||||
symbols = list(stock_info.keys())
|
symbols = list(stock_info.keys())
|
||||||
|
|
||||||
#KEEP THIS JUST IN CASE V7 GOES DOWN prepost_url = 'https://query2.finance.yahoo.com/v6/finance/quote?symbols='
|
#KEEP THIS JUST IN CASE V7 GOES DOWN prepost_url = 'https://query2.finance.yahoo.com/v6/finance/quote?symbols='
|
||||||
prepost_url = 'https://query2.finance.yahoo.com/v7/finance/quote?symbols='
|
prepost_url = 'https://query2.finance.yahoo.com/v6/finance/quote?symbols='
|
||||||
for symbol in symbols:
|
for symbol in symbols:
|
||||||
prepost_url += symbol + ','
|
prepost_url += symbol + ','
|
||||||
|
|
||||||
prepost_url += '&fields=regularMarketPreviousClose,regularMarketPrice,preMarketPrice,preMarketChangePercent,regularMarketChangePercent,regularMarketChange,preMarketChange,postMarketPrice,postMarketChange,postMarketChangePercent®ion=US&lang=en-US'
|
prepost_url += '&fields=regularMarketPreviousClose,regularMarketPrice,preMarketPrice,preMarketChangePercent,regularMarketChangePercent,regularMarketChange,preMarketChange,postMarketPrice,postMarketChange,postMarketChangePercent®ion=US&lang=en-US'
|
||||||
|
|
||||||
headers = {
|
headers = {'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7',
|
||||||
'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36'
|
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36'}
|
||||||
}
|
|
||||||
prepost = requests.get(prepost_url, headers=headers)
|
prepost = requests.get(prepost_url, headers=headers).json()
|
||||||
|
if "'error': {'code'" in str(prepost):
|
||||||
|
while True:
|
||||||
|
try:
|
||||||
|
with open('session.txt', 'rb') as f:
|
||||||
|
session = pickle.load(f)
|
||||||
|
with open('crumb.txt', 'r') as f:
|
||||||
|
crumb = f.read()
|
||||||
|
except:
|
||||||
|
getCookiesnCrumb()
|
||||||
|
with open('session.txt', 'rb') as f:
|
||||||
|
session = pickle.load(f)
|
||||||
|
with open('crumb.txt', 'r') as f:
|
||||||
|
crumb = f.read()
|
||||||
|
params = {'crumb': crumb}
|
||||||
|
|
||||||
|
prepost = session.get(prepost_url.replace('v6','v7'), headers=headers, params=params).json()
|
||||||
|
|
||||||
|
if "'error': {'code'" not in str(prepost):
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
getCookiesnCrumb()
|
||||||
|
time.sleep(5)
|
||||||
|
|
||||||
if 'Unauthorized' in str(prepost.json()):
|
prepost_data = prepost['quoteResponse']['result']
|
||||||
prepost = requests.get(prepost_url.replace('v7','v6'), headers=headers)
|
|
||||||
|
|
||||||
prepost_data = prepost.json()['quoteResponse']['result']
|
|
||||||
time_now = datetime.now(pytz.timezone('America/New_York')).strftime("%H:%M EST")
|
time_now = datetime.now(pytz.timezone('America/New_York')).strftime("%H:%M EST")
|
||||||
|
|
||||||
if len(prepost_data) > 0:
|
if len(prepost_data) > 0:
|
||||||
@ -198,7 +304,6 @@ def updateStocksPrePost(api_key, logf):
|
|||||||
|
|
||||||
with open('csv/prepost_settings.json', 'w+') as f:
|
with open('csv/prepost_settings.json', 'w+') as f:
|
||||||
json.dump(all_stocks_settings['symbols'], f)
|
json.dump(all_stocks_settings['symbols'], f)
|
||||||
|
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@ -661,74 +766,82 @@ def updateNews(api_key, logf):
|
|||||||
|
|
||||||
def updateWeather(api_key, logf):
|
def updateWeather(api_key, logf):
|
||||||
|
|
||||||
max_cities = 30
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
gn = geocoders.GeoNames(username='fintic')
|
gn = geocoders.GeoNames(username='fintic')
|
||||||
|
weather_codes = {
|
||||||
|
0: ['Clear', 'Clear sky'],
|
||||||
|
1: ['Clouds', 'few clouds'], 2: ['Clouds', 'scattered clouds'], 3: ['Clouds', 'overcast clouds'],
|
||||||
|
45: ['Fog', 'Fog'], 48: ['Fog', 'depositing rime fog'],
|
||||||
|
51: ['Drizzle', 'Light'], 53: ['Drizzle', 'moderate'], 55: ['Drizzle', 'dense'], 56: ['Drizzle', 'light'], 57: ['Drizzle', 'dense'],
|
||||||
|
61: ['Rain', 'light rain'], 63: ['Rain', 'moderate rain'], 65: ['Rain', 'very heavy rain'],
|
||||||
|
66: ['Rain', 'freezing rain'], 67: ['Rain', 'freezing rain'],
|
||||||
|
71: ['Snow', 'slight'], 73: ['Snow', 'moderate'], 75: ['Snow', 'heavy'], 77: ['Snow', 'Snow grains'], 85: ['Snow', 'slight'], 86: ['Snow', 'heavy'],
|
||||||
|
80: ['Rain', 'light intensity shower rain'], 81: ['Rain', 'shower rain'], 82: ['Rain', 'heavy intensity shower rain'],
|
||||||
|
95: ['Thunderstorm', 'Slight or moderate'], 96: ['Thunderstorm', 'slight hail'], 99: ['Thunderstorm', 'heavy hail']
|
||||||
|
}
|
||||||
f = open('csv/daily_weather.json', 'r')
|
f = open('csv/daily_weather.json', 'r')
|
||||||
all_daily_settings = json.load(f)
|
all_daily_settings = json.load(f)
|
||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
f = open('csv/current_weather.json', 'r')
|
f = open('csv/current_weather.json', 'r')
|
||||||
all_current_settings = json.load(f)
|
all_current_settings = json.load(f)
|
||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
current_locations = list(all_current_settings['locations'].keys())
|
current_locations = list(all_current_settings['locations'].keys())
|
||||||
daily_locations = list(all_daily_settings['locations'].keys())
|
daily_locations = list(all_daily_settings['locations'].keys())
|
||||||
|
|
||||||
all_locations = list(set(current_locations + daily_locations))
|
all_locations = list(set(current_locations + daily_locations))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
current_weathers = {}
|
current_weathers = {}
|
||||||
daily_weathers = {}
|
daily_weathers = {}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
for location in all_locations:
|
for location in all_locations:
|
||||||
loc = gn.geocode(location)
|
loc = gn.geocode(location)
|
||||||
current_weather = {}
|
current_weather = {}
|
||||||
|
|
||||||
lat = loc.latitude
|
lat = loc.latitude
|
||||||
lon = loc.longitude
|
lon = loc.longitude
|
||||||
url = 'https://api.openweathermap.org/data/2.5/onecall?lat={}&units=metric&lon={}&appid={}'.format(lat, lon, api_key)
|
url = 'https://api.open-meteo.com/v1/forecast?latitude={}&longitude={}&hourly=apparent_temperature,temperature_2m,relativehumidity_2m,precipitation_probability,weathercode,cloudcover,visibility,windspeed_10m,winddirection_10m,uv_index,is_day&daily=weathercode,temperature_2m_max,temperature_2m_min¤t_weather=true&timezone=UTC'.format(lat, lon)
|
||||||
r = requests.get(url)
|
r = requests.get(url).json()
|
||||||
|
|
||||||
weather = r.json()['current']
|
times = r['hourly']['time']
|
||||||
|
hour_now = datetime.now(pytz.utc).strftime('%Y-%m-%dT%H:00')
|
||||||
current_weather['main_weather'] = weather['weather'][0]['main']
|
index_pos = times.index(hour_now)
|
||||||
current_weather['description'] = weather['weather'][0]['description']
|
|
||||||
current_weather['temp'] = weather['temp']
|
main_weather_code = r['hourly']['weathercode'][index_pos]
|
||||||
current_weather['min_temp'] = r.json()['daily'][0]['temp']['min']
|
current_weather['main_weather'] = weather_codes[main_weather_code][0]
|
||||||
current_weather['max_temp'] = r.json()['daily'][0]['temp']['max']
|
current_weather['description'] = weather_codes[main_weather_code][1]
|
||||||
current_weather['feels_like'] = weather['feels_like']
|
current_weather['temp'] = r['hourly']['temperature_2m'][index_pos]
|
||||||
current_weather['humidity'] = weather['humidity']
|
current_weather['min_temp'] = r['daily']['temperature_2m_min'][0]
|
||||||
current_weather['clouds'] = weather['clouds']
|
current_weather['max_temp'] = r['daily']['temperature_2m_max'][0]
|
||||||
current_weather['wind_speed'] = weather['wind_speed']
|
current_weather['feels_like'] = r['hourly']['apparent_temperature'][index_pos]
|
||||||
current_weather['wind_direction'] = weather['wind_deg']
|
current_weather['humidity'] = r['hourly']['relativehumidity_2m'][index_pos]
|
||||||
current_weather['visibility'] = weather['visibility']
|
current_weather['clouds'] = r['hourly']['cloudcover'][index_pos]
|
||||||
current_weather['uv'] = weather['uvi']
|
if r['hourly']['visibility'][index_pos] > 10000:
|
||||||
current_weather['rain_chance'] = r.json()['hourly'][0]['pop']
|
current_weather['visibility'] = 10000
|
||||||
|
else:
|
||||||
|
current_weather['visibility'] = r['hourly']['visibility'][index_pos]
|
||||||
|
current_weather['uv'] = r['hourly']['uv_index'][index_pos]
|
||||||
|
current_weather['rain_chance'] = r['hourly']['precipitation_probability'][index_pos]
|
||||||
|
current_weather['wind_speed'] = r['hourly']['windspeed_10m'][index_pos]
|
||||||
|
current_weather['wind_direction'] = r['hourly']['winddirection_10m'][index_pos]
|
||||||
|
current_weather['is_day'] = r['hourly']['is_day'][index_pos]
|
||||||
|
|
||||||
if location in current_locations:
|
if location in current_locations:
|
||||||
current_weathers[location] = current_weather
|
current_weathers[location] = current_weather
|
||||||
|
|
||||||
daily_weather = []
|
daily_weather = []
|
||||||
daily = r.json()['daily']
|
daily = r['daily']
|
||||||
|
|
||||||
for day in daily:
|
for i in range(0,7):
|
||||||
dct = {}
|
dct = {}
|
||||||
dct['main_weather'] = day['weather'][0]['main']
|
daily_weather_code = daily['weathercode'][i]
|
||||||
dct['description'] = day['weather'][0]['description']
|
dct['main_weather'] = weather_codes[daily_weather_code][0]
|
||||||
dct['min_temp'] = day['temp']['min']
|
dct['description'] = weather_codes[daily_weather_code][1]
|
||||||
dct['max_temp'] = day['temp']['max']
|
dct['min_temp'] = daily['temperature_2m_min'][i]
|
||||||
|
dct['max_temp'] = daily['temperature_2m_max'][i]
|
||||||
daily_weather.append(dct)
|
daily_weather.append(dct)
|
||||||
|
|
||||||
#add relevant urrent information to first day in daily
|
# add relevant urrent information to first day in daily
|
||||||
daily_weather[0]['temp'] = weather['temp']
|
daily_weather[0]['temp'] = current_weather['temp']
|
||||||
daily_weather[0]['rain_chance'] = current_weather['rain_chance']
|
daily_weather[0]['rain_chance'] = current_weather['rain_chance']
|
||||||
daily_weather[0]['humidity'] = current_weather['humidity']
|
daily_weather[0]['humidity'] = current_weather['humidity']
|
||||||
daily_weather[0]['wind_speed'] = current_weather['wind_speed']
|
daily_weather[0]['wind_speed'] = current_weather['wind_speed']
|
||||||
@ -737,22 +850,20 @@ def updateWeather(api_key, logf):
|
|||||||
daily_weather[0]['wind_speed'] = current_weather['wind_speed']
|
daily_weather[0]['wind_speed'] = current_weather['wind_speed']
|
||||||
daily_weather[0]['wind_direction'] = current_weather['wind_direction']
|
daily_weather[0]['wind_direction'] = current_weather['wind_direction']
|
||||||
daily_weather[0]['visibility'] = current_weather['visibility']
|
daily_weather[0]['visibility'] = current_weather['visibility']
|
||||||
|
|
||||||
if location in daily_locations:
|
if location in daily_locations:
|
||||||
daily_weathers[location] = daily_weather
|
daily_weathers[location] = daily_weather
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
all_current_settings['locations'] = current_weathers
|
all_current_settings['locations'] = current_weathers
|
||||||
all_daily_settings['locations'] = daily_weathers
|
all_daily_settings['locations'] = daily_weathers
|
||||||
f = open( "csv/current_weather.json", 'w+' )
|
f = open("csv/current_weather.json", 'w+')
|
||||||
json.dump( all_current_settings, f)
|
json.dump(all_current_settings, f)
|
||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
f = open( "csv/daily_weather.json", 'w+' )
|
f = open("csv/daily_weather.json", 'w+')
|
||||||
json.dump( all_daily_settings, f)
|
json.dump(all_daily_settings, f)
|
||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
#logf = open('log.txt', "a")
|
#logf = open('log.txt', "a")
|
||||||
@ -791,30 +902,55 @@ def updateLeagueTables(api_key, logf):
|
|||||||
|
|
||||||
all_data = r.json()
|
all_data = r.json()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
for i,l in enumerate(all_data):
|
for i,l in enumerate(all_data):
|
||||||
|
|
||||||
league = list(l.keys())[0]
|
league = list(l.keys())[0]
|
||||||
|
|
||||||
|
|
||||||
teams = []
|
teams = []
|
||||||
|
if league == 'pga' or league == 'lpga':
|
||||||
|
logo_files = []
|
||||||
for d in all_data[i][league]:
|
for d in all_data[i][league]:
|
||||||
team = {}
|
del d['_id'], d['updated']
|
||||||
|
teams.append(d)
|
||||||
|
try:
|
||||||
|
if d['country'].split('/')[-1].split('&')[0] not in os.listdir('logos/ufc_countries/'):
|
||||||
team['name'] = d['strTeam']
|
urllib.request.urlretrieve(d['country'], 'logos/ufc_countries/' + d['country'].split('/')[-1].split('&')[0])
|
||||||
team['wins'] = d['intWin']
|
except:
|
||||||
team['loss'] = d['intLoss']
|
pass
|
||||||
team['draw'] = d['intDraw']
|
try:
|
||||||
#team['played'] = d['intPlayed']
|
if league == 'pga':
|
||||||
team['standing'] = d['intRank']
|
if d['photo'].split('/')[-1].split('&')[0] not in os.listdir('logos/pga_rank/'):
|
||||||
#team['points'] = d['intPoints']
|
urllib.request.urlretrieve(d['photo'],'logos/pga_rank/' + d['photo'].split('/')[-1].split('&')[0])
|
||||||
|
elif league == 'lpga':
|
||||||
teams.append(team)
|
if d['photo'].split('/')[-1] not in os.listdir('logos/lpga_rank/'):
|
||||||
|
urllib.request.urlretrieve(d['photo'],'logos/lpga_rank/' + d['photo'].split('/')[-1])
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
try:
|
||||||
|
if league == 'pga':
|
||||||
|
logo_files.append(d['photo'].split('/')[-1].split('&')[0])
|
||||||
|
elif league == 'lpga':
|
||||||
|
logo_files.append(d['photo'].split('/')[-1])
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
if league == 'pga':
|
||||||
|
for file in os.listdir('logos/pga_rank/'):
|
||||||
|
if file not in logo_files:
|
||||||
|
os.remove('logos/pga_rank/'+ file)
|
||||||
|
elif league == 'lpga':
|
||||||
|
for file in os.listdir('logos/lpga_rank/'):
|
||||||
|
if file not in logo_files:
|
||||||
|
os.remove('logos/lpga_rank/'+ file)
|
||||||
|
else:
|
||||||
|
for d in all_data[i][league]:
|
||||||
|
team = {}
|
||||||
|
team['name'] = d['strTeam']
|
||||||
|
team['wins'] = d['intWin']
|
||||||
|
team['loss'] = d['intLoss']
|
||||||
|
team['draw'] = d['intDraw']
|
||||||
|
#team['played'] = d['intPlayed']
|
||||||
|
team['standing'] = d['intRank']
|
||||||
|
#team['points'] = d['intPoints']
|
||||||
|
teams.append(team)
|
||||||
|
|
||||||
leagues_info[league.upper()] = teams
|
leagues_info[league.upper()] = teams
|
||||||
|
|
||||||
all_settings['leagues'] = leagues_info
|
all_settings['leagues'] = leagues_info
|
||||||
@ -1041,6 +1177,12 @@ def updateLeagueEvents(api_key, time, logf):
|
|||||||
event['date2'] = d['dateEvent2']
|
event['date2'] = d['dateEvent2']
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
try:
|
||||||
|
event['total_yards'] = d['total_yards']
|
||||||
|
event['shots_par'] = d['shots_par']
|
||||||
|
event['purse'] = d['purse']
|
||||||
|
except:
|
||||||
|
pass
|
||||||
event['event'] = d['strEvent'].replace("\u2019","'")
|
event['event'] = d['strEvent'].replace("\u2019","'")
|
||||||
event['venue'] = d['strVenue'].replace("\u2019","'")
|
event['venue'] = d['strVenue'].replace("\u2019","'")
|
||||||
event['city'] = d['strCity'].replace("\u2019","'")
|
event['city'] = d['strCity'].replace("\u2019","'")
|
||||||
@ -1054,98 +1196,107 @@ def updateLeagueEvents(api_key, time, logf):
|
|||||||
|
|
||||||
if time != 'upcoming':
|
if time != 'upcoming':
|
||||||
if (league == 'PGA') or (league == 'LPGA') or (league == 'PGA_EU'):
|
if (league == 'PGA') or (league == 'LPGA') or (league == 'PGA_EU'):
|
||||||
event['golf_standings'] = d['strResult']
|
# event['golf_standings'] = d['strResult']
|
||||||
|
event['golf_rankings'] = d['player_results']
|
||||||
|
for player in event['golf_rankings']:
|
||||||
|
try:
|
||||||
|
if player['country'].split('/')[-1].split('&')[0] not in os.listdir('logos/ufc_countries/'):
|
||||||
|
urllib.request.urlretrieve(player['country'], 'logos/ufc_countries/' + player['country'].split('/')[-1].split('&')[0])
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
# rank = ['n1', 'n2', 'n3', 'n4', 'n5', 'n6', 'n7', 'n8', 'n9', 'n10', 'T1', 'T2', 'T3', 'T4', 'T5',
|
||||||
|
# 'T6', 'T7', 'T8', 'T9', 'T10']
|
||||||
|
# def convert(string):
|
||||||
|
# string = repr(string).replace('/', '')
|
||||||
|
# li = list(string.split('\\'))
|
||||||
|
# return li
|
||||||
|
|
||||||
rank = ['n1', 'n2', 'n3', 'n4', 'n5', 'n6', 'n7', 'n8', 'n9', 'n10', 'T1', 'T2', 'T3', 'T4', 'T5',
|
# str3 = convert(event['golf_standings'])
|
||||||
'T6', 'T7', 'T8', 'T9', 'T10']
|
|
||||||
|
|
||||||
def convert(string):
|
# players = []
|
||||||
string = repr(string).replace('/', '')
|
|
||||||
li = list(string.split('\\'))
|
|
||||||
return li
|
|
||||||
|
|
||||||
str3 = convert(event['golf_standings'])
|
|
||||||
|
|
||||||
players = []
|
|
||||||
|
|
||||||
|
|
||||||
for each in str3:
|
# for each in str3:
|
||||||
each = each.replace('nT', 'T', 1)
|
# each = each.replace('nT', 'T', 1)
|
||||||
if each[:2] in rank:
|
# if each[:2] in rank:
|
||||||
try:
|
# try:
|
||||||
first_space = each.find(' ', 1)
|
# first_space = each.find(' ', 1)
|
||||||
second_space = each.find(' ', 4)
|
# second_space = each.find(' ', 4)
|
||||||
first_name = each[first_space:second_space].lstrip()
|
# first_name = each[first_space:second_space].lstrip()
|
||||||
initial = first_name[0] + '.'
|
# initial = first_name[0] + '.'
|
||||||
each = each.replace(first_name,initial)
|
# each = each.replace(first_name,initial)
|
||||||
except:
|
# except:
|
||||||
pass
|
# pass
|
||||||
interator = each.find('-')
|
# interator = each.find('-')
|
||||||
if interator < 0:
|
# if interator < 0:
|
||||||
interator = 0
|
# interator = 0
|
||||||
interator2 = each[interator:interator + 3]
|
# interator2 = each[interator:interator + 3]
|
||||||
result = each.split(interator2, 1)[0] + interator2
|
# result = each.split(interator2, 1)[0] + interator2
|
||||||
players.append(result.rstrip())
|
# players.append(result.rstrip())
|
||||||
|
|
||||||
event['golf_standings'] = players
|
# event['golf_standings'] = players
|
||||||
|
|
||||||
|
|
||||||
elif (league == 'LIV'):
|
elif (league == 'LIV'):
|
||||||
event['golf_standings'] = d['strResult']
|
# event['golf_standings'] = d['strResult']
|
||||||
|
event['golf_rankings'] = d['player_results']
|
||||||
|
for player in event['golf_rankings']:
|
||||||
|
try:
|
||||||
|
if player['country'].split('/')[-1].split('&')[0] not in os.listdir('logos/ufc_countries/'):
|
||||||
|
urllib.request.urlretrieve(player['country'], 'logos/ufc_countries/' + player['country'].split('/')[-1].split('&')[0])
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
# rank = ['n1', 'n2', 'n3', 'n4', 'n5', 'n6', 'n7', 'n8', 'n9', 'n10', 'T1', 'T2', 'T3', 'T4', 'T5',
|
||||||
|
# 'T6', 'T7', 'T8', 'T9', 'T10']
|
||||||
|
# def convert(string):
|
||||||
|
# string = repr(string).replace('/', '')
|
||||||
|
# li = list(string.split('\\'))
|
||||||
|
# return li
|
||||||
|
|
||||||
rank = ['n1', 'n2', 'n3', 'n4', 'n5', 'n6', 'n7', 'n8', 'n9', 'n10', 'T1', 'T2', 'T3', 'T4', 'T5',
|
# try:
|
||||||
'T6', 'T7', 'T8', 'T9', 'T10']
|
# str3 = convert(event['golf_standings'].split('--------------------------------------')[0])
|
||||||
|
# strTeams = convert(event['golf_standings'].split('--------------------------------------')[1])
|
||||||
|
# except:
|
||||||
|
# pass
|
||||||
|
|
||||||
def convert(string):
|
# players = []
|
||||||
string = repr(string).replace('/', '')
|
# teams = []
|
||||||
li = list(string.split('\\'))
|
|
||||||
return li
|
|
||||||
|
|
||||||
try:
|
# try:
|
||||||
str3 = convert(event['golf_standings'].split('--------------------------------------')[0])
|
# for each in str3:
|
||||||
strTeams = convert(event['golf_standings'].split('--------------------------------------')[1])
|
# each = each.replace('nT', 'T', 1)
|
||||||
except:
|
# if each[:2] in rank:
|
||||||
pass
|
# try:
|
||||||
|
# first_space = each.find(' ', 1)
|
||||||
|
# second_space = each.find(' ', 4)
|
||||||
|
# first_name = each[first_space:second_space].lstrip()
|
||||||
|
# initial = first_name[0] + '.'
|
||||||
|
# each = each.replace(first_name,initial)
|
||||||
|
# except:
|
||||||
|
# pass
|
||||||
|
# interator = each.find('-')
|
||||||
|
# if interator < 0:
|
||||||
|
# interator = 0
|
||||||
|
# interator2 = each[interator:interator + 3]
|
||||||
|
# result = each.split(interator2, 1)[0] + interator2
|
||||||
|
# players.append(result.rstrip())
|
||||||
|
|
||||||
players = []
|
# for each in strTeams:
|
||||||
teams = []
|
# each = each.replace('nT', 'T', 1)
|
||||||
|
# if each[:2] in rank:
|
||||||
try:
|
# each = each.split('GC')
|
||||||
for each in str3:
|
# score = each[1].rfind(' ')
|
||||||
each = each.replace('nT', 'T', 1)
|
# score2 = each[1][score:score+4]
|
||||||
if each[:2] in rank:
|
# each2 = each[0] + score2
|
||||||
try:
|
# teams.append(each2)
|
||||||
first_space = each.find(' ', 1)
|
# except:
|
||||||
second_space = each.find(' ', 4)
|
# pass
|
||||||
first_name = each[first_space:second_space].lstrip()
|
|
||||||
initial = first_name[0] + '.'
|
|
||||||
each = each.replace(first_name,initial)
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
interator = each.find('-')
|
|
||||||
if interator < 0:
|
|
||||||
interator = 0
|
|
||||||
interator2 = each[interator:interator + 3]
|
|
||||||
result = each.split(interator2, 1)[0] + interator2
|
|
||||||
players.append(result.rstrip())
|
|
||||||
|
|
||||||
for each in strTeams:
|
|
||||||
each = each.replace('nT', 'T', 1)
|
|
||||||
if each[:2] in rank:
|
|
||||||
each = each.split('GC')
|
|
||||||
score = each[1].rfind(' ')
|
|
||||||
score2 = each[1][score:score+4]
|
|
||||||
each2 = each[0] + score2
|
|
||||||
teams.append(each2)
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
|
|
||||||
event['golf_standings'] = [players] + [teams]
|
|
||||||
|
|
||||||
|
# event['golf_standings'] = [players] + [teams]
|
||||||
else:
|
else:
|
||||||
event['away_score'] = d['intAwayScore']
|
event['away_score'] = d['intAwayScore']
|
||||||
event['home_score'] = d['intHomeScore']
|
event['home_score'] = d['intHomeScore']
|
||||||
|
|
||||||
events.append(event)
|
events.append(event)
|
||||||
leagues_info[league.upper()] = events
|
leagues_info[league.upper()] = events
|
||||||
all_settings['leagues'] = leagues_info
|
all_settings['leagues'] = leagues_info
|
||||||
|
6
logos/lpga_rank/blank.rtf
Normal file
6
logos/lpga_rank/blank.rtf
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
{\rtf1\ansi\ansicpg1252\cocoartf2513
|
||||||
|
\cocoatextscaling0\cocoaplatform0{\fonttbl}
|
||||||
|
{\colortbl;\red255\green255\blue255;}
|
||||||
|
{\*\expandedcolortbl;;}
|
||||||
|
\margl1440\margr1440\vieww10800\viewh8400\viewkind0
|
||||||
|
}
|
6
logos/pga_rank/blank.rtf
Normal file
6
logos/pga_rank/blank.rtf
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
{\rtf1\ansi\ansicpg1252\cocoartf2513
|
||||||
|
\cocoatextscaling0\cocoaplatform0{\fonttbl}
|
||||||
|
{\colortbl;\red255\green255\blue255;}
|
||||||
|
{\*\expandedcolortbl;;}
|
||||||
|
\margl1440\margr1440\vieww10800\viewh8400\viewkind0
|
||||||
|
}
|
BIN
logos/sports/league_logos/lpga_1.png
Normal file
BIN
logos/sports/league_logos/lpga_1.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
BIN
logos/sports/league_logos/pga_1.png
Normal file
BIN
logos/sports/league_logos/pga_1.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.6 KiB |
66
server.py
66
server.py
@ -146,8 +146,8 @@ def index():
|
|||||||
not_displaying = [f for f in all_features if f not in currently_displaying[0]]
|
not_displaying = [f for f in all_features if f not in currently_displaying[0]]
|
||||||
not_displaying2 = [f for f in all_features if f not in currently_displaying[1]]
|
not_displaying2 = [f for f in all_features if f not in currently_displaying[1]]
|
||||||
|
|
||||||
with open('api_keys.txt', 'r') as f:
|
# with open('api_keys.txt', 'r') as f:
|
||||||
api_key2 = f.readlines()
|
# api_key2 = f.readlines()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
with open('movie_api_key.txt', 'r') as f:
|
with open('movie_api_key.txt', 'r') as f:
|
||||||
@ -248,10 +248,10 @@ def index():
|
|||||||
except:
|
except:
|
||||||
scheduler_settings = {"shutdown": {"hour": "00", "minute": "00", "enabled": False}, "reboot":{"hour": "00", "minute": "00", "enabled": False}, "timezone": "GMT", "brightness1":{"hour": "00", "minute": "00", "bright": "10", "enabled": False}, "brightness2":{"hour": "00", "minute": "00", "bright": "10", "enabled": False}, "brightness3":{"hour": "00", "minute": "00", "bright": "10", "enabled": False}, "brightness4":{"hour": "00", "minute": "00", "bright": "10", "enabled": False}}
|
scheduler_settings = {"shutdown": {"hour": "00", "minute": "00", "enabled": False}, "reboot":{"hour": "00", "minute": "00", "enabled": False}, "timezone": "GMT", "brightness1":{"hour": "00", "minute": "00", "bright": "10", "enabled": False}, "brightness2":{"hour": "00", "minute": "00", "bright": "10", "enabled": False}, "brightness3":{"hour": "00", "minute": "00", "bright": "10", "enabled": False}, "brightness4":{"hour": "00", "minute": "00", "bright": "10", "enabled": False}}
|
||||||
|
|
||||||
try: # incase this doesnt exist
|
# try: # incase this doesnt exist
|
||||||
api_keys = api_key2[1]
|
# api_keys = api_key2[1]
|
||||||
except:
|
# except:
|
||||||
api_keys = ''
|
# api_keys = ''
|
||||||
|
|
||||||
try:
|
try:
|
||||||
movie_api_key = movie_api[0]
|
movie_api_key = movie_api[0]
|
||||||
@ -299,7 +299,6 @@ def index():
|
|||||||
'message_settings':message_settings,
|
'message_settings':message_settings,
|
||||||
'professional':professional,
|
'professional':professional,
|
||||||
'general_settings':general_settings,
|
'general_settings':general_settings,
|
||||||
'api_keys':api_keys,
|
|
||||||
'movie_api_key':movie_api_key,
|
'movie_api_key':movie_api_key,
|
||||||
'ipo_api_key':ipo_api_key,
|
'ipo_api_key':ipo_api_key,
|
||||||
'wifi_SSID':wifi_SSID,
|
'wifi_SSID':wifi_SSID,
|
||||||
@ -755,25 +754,25 @@ def hostname():
|
|||||||
return index()
|
return index()
|
||||||
|
|
||||||
|
|
||||||
@app.route("/saveWeatherAPIKey", methods = ['PUT', 'POST'])
|
# @app.route("/saveWeatherAPIKey", methods = ['PUT', 'POST'])
|
||||||
def saveWeatherAPIKey():
|
# def saveWeatherAPIKey():
|
||||||
|
|
||||||
data= request.data.decode('utf-8')
|
# data= request.data.decode('utf-8')
|
||||||
settings = json.loads(data)
|
# settings = json.loads(data)
|
||||||
|
|
||||||
key = settings['api_key']
|
# key = settings['api_key']
|
||||||
|
|
||||||
with open('./api_keys.txt') as f:
|
# with open('./api_keys.txt') as f:
|
||||||
lines = f.readlines()
|
# lines = f.readlines()
|
||||||
if len(lines) == 1:
|
# if len(lines) == 1:
|
||||||
lines.append(str(key))
|
# lines.append(str(key))
|
||||||
elif len(lines) == 2:
|
# elif len(lines) == 2:
|
||||||
lines[1] = str(key)
|
# lines[1] = str(key)
|
||||||
|
|
||||||
with open('./api_keys.txt', 'w') as f:
|
# with open('./api_keys.txt', 'w') as f:
|
||||||
for line in lines:
|
# for line in lines:
|
||||||
f.write(line)
|
# f.write(line)
|
||||||
return index()
|
# return index()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -1334,6 +1333,29 @@ def saveSchedulerSettings():
|
|||||||
return index()
|
return index()
|
||||||
|
|
||||||
|
|
||||||
|
@app.route("/setTop20or10", methods = ['PUT', 'POST'])
|
||||||
|
def setTop20or10():
|
||||||
|
|
||||||
|
data= request.data.decode('utf-8')
|
||||||
|
input_settings = json.loads(data)
|
||||||
|
|
||||||
|
with open('csv/league_tables.json','r') as f:
|
||||||
|
league_settings = json.load(f)
|
||||||
|
|
||||||
|
if input_settings == 'Top 20':
|
||||||
|
input_settings = 20
|
||||||
|
elif input_settings == 'Top 10':
|
||||||
|
input_settings = 10
|
||||||
|
else:
|
||||||
|
input_settings = 20
|
||||||
|
|
||||||
|
league_settings['top20'] = input_settings
|
||||||
|
|
||||||
|
f = open('csv/league_tables.json', 'w')
|
||||||
|
json.dump(league_settings, f)
|
||||||
|
f.close()
|
||||||
|
|
||||||
|
return index()
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
@ -28,10 +28,10 @@ echo '{"feature": "Stocks", "speed": "medium","speed2": "medium", "animation": "
|
|||||||
|
|
||||||
echo '{"feature": "Stocks", "speed": "fast", "speed2": "fast", "animation": "down", "percent": true, "point": true, "logos": true, "chart": false, "title": true, "symbols": {"BRENTOIL": {"current": "123.053", "unit": "bbl", "24hr_change": "1.0150", "percent_change": "0.83"}, "WTIOIL": {"current": "121.588", "unit": "bbl", "24hr_change": "0.8902", "percent_change": "0.74"}, "XAU": {"current": "1821.205", "unit": "oz", "24hr_change": "4.0045", "percent_change": "0.22"}, "XAG": {"current": "21.1034", "unit": "oz", "24hr_change": "-0.0550", "percent_change": "-0.26"}, "XCU": {"current": "0.2633", "unit": "oz", "24hr_change": "-0.0006", "percent_change": "-0.22"}, "NG": {"current": "8.6595", "unit": "mmbtu", "24hr_change": "-0.0236", "percent_change": "-0.27"}, "WHEAT": {"current": "393.123", "unit": "ton", "24hr_change": "-1.2642", "percent_change": "-0.32"}, "COTTON": {"current": "1.4494", "unit": "lb", "24hr_change": "0.0004", "percent_change": "0.03"}, "RICE": {"current": "16.3849", "unit": "cwt", "24hr_change": "0.0093", "percent_change": "0.06"}, "SUGAR": {"current": "0.1866", "unit": "lb", "24hr_change": "-0.0007", "percent_change": "-0.40"}, "COCOA": {"current": "2374.074", "unit": "ton", "24hr_change": "2.5206", "percent_change": "0.11"}, "LUMBER": {"current": "527.842", "unit": "oz", "24hr_change": "0.2641", "percent_change": "0.05"}, "SOYBEAN": {"current": "17.1621", "unit": "bu", "24hr_change": "0.0270", "percent_change": "0.16"}}}' >> commodities_settings.json
|
echo '{"feature": "Stocks", "speed": "fast", "speed2": "fast", "animation": "down", "percent": true, "point": true, "logos": true, "chart": false, "title": true, "symbols": {"BRENTOIL": {"current": "123.053", "unit": "bbl", "24hr_change": "1.0150", "percent_change": "0.83"}, "WTIOIL": {"current": "121.588", "unit": "bbl", "24hr_change": "0.8902", "percent_change": "0.74"}, "XAU": {"current": "1821.205", "unit": "oz", "24hr_change": "4.0045", "percent_change": "0.22"}, "XAG": {"current": "21.1034", "unit": "oz", "24hr_change": "-0.0550", "percent_change": "-0.26"}, "XCU": {"current": "0.2633", "unit": "oz", "24hr_change": "-0.0006", "percent_change": "-0.22"}, "NG": {"current": "8.6595", "unit": "mmbtu", "24hr_change": "-0.0236", "percent_change": "-0.27"}, "WHEAT": {"current": "393.123", "unit": "ton", "24hr_change": "-1.2642", "percent_change": "-0.32"}, "COTTON": {"current": "1.4494", "unit": "lb", "24hr_change": "0.0004", "percent_change": "0.03"}, "RICE": {"current": "16.3849", "unit": "cwt", "24hr_change": "0.0093", "percent_change": "0.06"}, "SUGAR": {"current": "0.1866", "unit": "lb", "24hr_change": "-0.0007", "percent_change": "-0.40"}, "COCOA": {"current": "2374.074", "unit": "ton", "24hr_change": "2.5206", "percent_change": "0.11"}, "LUMBER": {"current": "527.842", "unit": "oz", "24hr_change": "0.2641", "percent_change": "0.05"}, "SOYBEAN": {"current": "17.1621", "unit": "bu", "24hr_change": "0.0270", "percent_change": "0.16"}}}' >> commodities_settings.json
|
||||||
echo '{"feature": "Stocks", "speed": "fast", "speed2": "slow", "animation": "up", "percent": true, "point": true, "logos": true, "chart": false, "title": true, "symbols": {"^HSI": {"name": "HSI", "current": "18083.06", "point_change": "1003.55", "percent_change": "5.88"}, "^GSPC": {"name": "S&P 500", "current": "3790.93", "point_change": "112.50", "percent_change": "3.06"}, "^RUT": {"name": "RUSSELL 2000", "current": "1775.77", "point_change": "66.90", "percent_change": "3.91"}, "^GDAXI": {"name": "DAX", "current": "12648.95", "point_change": "-21.53", "percent_change": "-0.17"}, "^FTSE": {"name": "FTSE 100", "current": "7058.68", "point_change": "-27.82", "percent_change": "-0.39"}, "^FCHI": {"name": "CAC 40", "current": "6031.45", "point_change": "-8.24", "percent_change": "-0.14"}, "399001.SZ": {"name": "SZSE", "current": "10778.61", "point_change": "-140.83", "percent_change": "-1.29"}, "^STOXX50E": {"name": "STOXX 50", "current": "3476.55", "point_change": "-7.93", "percent_change": "-0.23"}, "^AXJO": {"name": "ASX 200", "current": "6815.70", "point_change": "116.40", "percent_change": "1.74"}, "^DJI": {"name": "DOW JONES", "current": "30316.32", "point_change": "825.43", "percent_change": "2.80"}, "^STOXX": {"name": "STOXX 600", "current": "402.33", "point_change": "-0.70", "percent_change": "-0.17"}}}' >> indices_settings.json
|
echo '{"feature": "Stocks", "speed": "fast", "speed2": "slow", "animation": "up", "percent": true, "point": true, "logos": true, "chart": false, "title": true, "symbols": {"^HSI": {"name": "HSI", "current": "18083.06", "point_change": "1003.55", "percent_change": "5.88"}, "^GSPC": {"name": "S&P 500", "current": "3790.93", "point_change": "112.50", "percent_change": "3.06"}, "^RUT": {"name": "RUSSELL 2000", "current": "1775.77", "point_change": "66.90", "percent_change": "3.91"}, "^GDAXI": {"name": "DAX", "current": "12648.95", "point_change": "-21.53", "percent_change": "-0.17"}, "^FTSE": {"name": "FTSE 100", "current": "7058.68", "point_change": "-27.82", "percent_change": "-0.39"}, "^FCHI": {"name": "CAC 40", "current": "6031.45", "point_change": "-8.24", "percent_change": "-0.14"}, "399001.SZ": {"name": "SZSE", "current": "10778.61", "point_change": "-140.83", "percent_change": "-1.29"}, "^STOXX50E": {"name": "STOXX 50", "current": "3476.55", "point_change": "-7.93", "percent_change": "-0.23"}, "^AXJO": {"name": "ASX 200", "current": "6815.70", "point_change": "116.40", "percent_change": "1.74"}, "^DJI": {"name": "DOW JONES", "current": "30316.32", "point_change": "825.43", "percent_change": "2.80"}, "^STOXX": {"name": "STOXX 600", "current": "402.33", "point_change": "-0.70", "percent_change": "-0.17"}}}' >> indices_settings.json
|
||||||
echo '{"feature": "Sports (Team Stats)", "speed": "medium", "speed2": "medium","animation": "down", "title": true, "leagues": {}}' >> league_tables.json
|
echo '{"feature": "Sports (Team Stats)", "speed": "medium", "speed2": "medium","animation": "down", "title": true, "top20": 20, "leagues": {}}' >> league_tables.json
|
||||||
echo {\"feature\": \"Current Weather\", \"speed\": \"medium\", \"animation\": \"down\", \"temp\": \"celsius\", \"wind_speed\": \"miles/sec\", \"colour\": \"white\", \"city_colour\": \"yellow\", \"title\": true, \"locations\": {}, \"current_weather\": true} >> current_weather.json
|
echo {\"feature\": \"Current Weather\", \"speed\": \"medium\", \"animation\": \"down\", \"temp\": \"celsius\", \"wind_speed\": \"miles/hour\", \"colour\": \"white\", \"city_colour\": \"yellow\", \"title\": true, \"locations\": {}, \"current_weather\": true} >> current_weather.json
|
||||||
echo '{"feature": "Stocks", "speed": "medium", "speed2": "medium", "animation": "down", "percent": false, "point": true, "logos": true, "chart": false, "title": true, "symbols": {"AAPL": {"current": "164.02", "change": "-1.59", "percent_change": "-0.97"}, "MSFT": {"current": "288.29", "change": "-1.32", "percent_change": "-0.46"}, "GOOG": {"current": "2586.74", "change": "-34.01", "percent_change": "-1.31"}, "NFLX": {"current": "380.52", "change": "-7.59", "percent_change": "-1.99"}}, "prepost": false}' >> stocks_settings.json
|
echo '{"feature": "Stocks", "speed": "medium", "speed2": "medium", "animation": "down", "percent": false, "point": true, "logos": true, "chart": false, "title": true, "symbols": {"AAPL": {"current": "164.02", "change": "-1.59", "percent_change": "-0.97"}, "MSFT": {"current": "288.29", "change": "-1.32", "percent_change": "-0.46"}, "GOOG": {"current": "2586.74", "change": "-34.01", "percent_change": "-1.31"}, "NFLX": {"current": "380.52", "change": "-7.59", "percent_change": "-1.99"}}, "prepost": false}' >> stocks_settings.json
|
||||||
echo {\"feature\": \"Current Weather\", \"speed\": \"medium\", \"animation\": \"down\", \"temp\": \"celsius\", \"wind_speed\": \"miles/sec\", \"colour\": \"white\", \"city_colour\": \"yellow\", \"title\": true, \"locations\": {}, \"current_weather\": true} >> daily_weather.json
|
echo {\"feature\": \"Current Weather\", \"speed\": \"medium\", \"animation\": \"down\", \"temp\": \"celsius\", \"wind_speed\": \"miles/hour\", \"colour\": \"white\", \"city_colour\": \"yellow\", \"title\": true, \"locations\": {}, \"current_weather\": true} >> daily_weather.json
|
||||||
echo '{"feature": "Sports (Live Games)", "speed": "medium", "speed2": "medium", "animation": "down", "title": true, "leagues": {}}' >> live_games.json
|
echo '{"feature": "Sports (Live Games)", "speed": "medium", "speed2": "medium", "animation": "down", "title": true, "leagues": {}}' >> live_games.json
|
||||||
echo '{"feature": "Sports (Live Games)", "speed": "medium", "speed2": "medium", "animation": "down", "title": true, "leagues": {"MLB": [[{"home_team": "Columbus Blue Jackets", "home_score": "4", "away_team": "Buffalo Sabres", "away_score": "9", "time": "Final", "date": "2022-12-08", "isLive": "post"}, {"home_team": "Philadelphia Flyers", "home_score": "1", "away_team": "Washington Capitals", "away_score": "4", "time": "Final", "date": "2022-12-08", "isLive": "post"}, {"home_team": "Calgary Flames", "home_score": "5", "away_team": "Minnesota Wild", "away_score": "3", "time": "Final", "date": "2022-12-08", "isLive": "post"}, {"home_team": "Colorado Avalanche", "home_score": "0", "away_team": "Boston Bruins", "away_score": "4", "time": "Final", "date": "2022-12-08", "isLive": "post"}, {"home_team": "Edmonton Oilers", "home_score": "8", "away_team": "Arizona Coyotes", "away_score": "2", "time": "Final", "date": "2022-12-08", "isLive": "post"}, {"home_team": "Vegas Golden Knights", "home_score": "1", "away_team": "New York Rangers", "away_score": "5", "time": "Final", "date": "2022-12-08", "isLive": "post"}, {"home_team": "San Jose Sharks", "home_score": "5", "away_team": "Vancouver Canucks", "away_score": "6", "time": "Final/OT", "date": "2022-12-08", "isLive": "post"}], false, "no_live", "no_upcoming"]}}' >> live_mlb.json
|
echo '{"feature": "Sports (Live Games)", "speed": "medium", "speed2": "medium", "animation": "down", "title": true, "leagues": {"MLB": [[{"home_team": "Columbus Blue Jackets", "home_score": "4", "away_team": "Buffalo Sabres", "away_score": "9", "time": "Final", "date": "2022-12-08", "isLive": "post"}, {"home_team": "Philadelphia Flyers", "home_score": "1", "away_team": "Washington Capitals", "away_score": "4", "time": "Final", "date": "2022-12-08", "isLive": "post"}, {"home_team": "Calgary Flames", "home_score": "5", "away_team": "Minnesota Wild", "away_score": "3", "time": "Final", "date": "2022-12-08", "isLive": "post"}, {"home_team": "Colorado Avalanche", "home_score": "0", "away_team": "Boston Bruins", "away_score": "4", "time": "Final", "date": "2022-12-08", "isLive": "post"}, {"home_team": "Edmonton Oilers", "home_score": "8", "away_team": "Arizona Coyotes", "away_score": "2", "time": "Final", "date": "2022-12-08", "isLive": "post"}, {"home_team": "Vegas Golden Knights", "home_score": "1", "away_team": "New York Rangers", "away_score": "5", "time": "Final", "date": "2022-12-08", "isLive": "post"}, {"home_team": "San Jose Sharks", "home_score": "5", "away_team": "Vancouver Canucks", "away_score": "6", "time": "Final/OT", "date": "2022-12-08", "isLive": "post"}], false, "no_live", "no_upcoming"]}}' >> live_mlb.json
|
||||||
echo '{"feature": "Sports (Live Games)", "speed": "medium", "speed2": "medium", "animation": "down", "title": true, "leagues": {"MLS": [[{"home_team": "Columbus Blue Jackets", "home_score": "4", "away_team": "Buffalo Sabres", "away_score": "9", "time": "Final", "date": "2022-12-08", "isLive": "post"}, {"home_team": "Philadelphia Flyers", "home_score": "1", "away_team": "Washington Capitals", "away_score": "4", "time": "Final", "date": "2022-12-08", "isLive": "post"}, {"home_team": "Calgary Flames", "home_score": "5", "away_team": "Minnesota Wild", "away_score": "3", "time": "Final", "date": "2022-12-08", "isLive": "post"}, {"home_team": "Colorado Avalanche", "home_score": "0", "away_team": "Boston Bruins", "away_score": "4", "time": "Final", "date": "2022-12-08", "isLive": "post"}, {"home_team": "Edmonton Oilers", "home_score": "8", "away_team": "Arizona Coyotes", "away_score": "2", "time": "Final", "date": "2022-12-08", "isLive": "post"}, {"home_team": "Vegas Golden Knights", "home_score": "1", "away_team": "New York Rangers", "away_score": "5", "time": "Final", "date": "2022-12-08", "isLive": "post"}, {"home_team": "San Jose Sharks", "home_score": "5", "away_team": "Vancouver Canucks", "away_score": "6", "time": "Final/OT", "date": "2022-12-08", "isLive": "post"}], false, "no_live", "no_upcoming"]}}' >> live_mls.json
|
echo '{"feature": "Sports (Live Games)", "speed": "medium", "speed2": "medium", "animation": "down", "title": true, "leagues": {"MLS": [[{"home_team": "Columbus Blue Jackets", "home_score": "4", "away_team": "Buffalo Sabres", "away_score": "9", "time": "Final", "date": "2022-12-08", "isLive": "post"}, {"home_team": "Philadelphia Flyers", "home_score": "1", "away_team": "Washington Capitals", "away_score": "4", "time": "Final", "date": "2022-12-08", "isLive": "post"}, {"home_team": "Calgary Flames", "home_score": "5", "away_team": "Minnesota Wild", "away_score": "3", "time": "Final", "date": "2022-12-08", "isLive": "post"}, {"home_team": "Colorado Avalanche", "home_score": "0", "away_team": "Boston Bruins", "away_score": "4", "time": "Final", "date": "2022-12-08", "isLive": "post"}, {"home_team": "Edmonton Oilers", "home_score": "8", "away_team": "Arizona Coyotes", "away_score": "2", "time": "Final", "date": "2022-12-08", "isLive": "post"}, {"home_team": "Vegas Golden Knights", "home_score": "1", "away_team": "New York Rangers", "away_score": "5", "time": "Final", "date": "2022-12-08", "isLive": "post"}, {"home_team": "San Jose Sharks", "home_score": "5", "away_team": "Vancouver Canucks", "away_score": "6", "time": "Final/OT", "date": "2022-12-08", "isLive": "post"}], false, "no_live", "no_upcoming"]}}' >> live_mls.json
|
||||||
|
146
static/app.js
146
static/app.js
@ -1252,14 +1252,12 @@ function getWeatherSettings(page) {
|
|||||||
let speed = getSelected(page.querySelectorAll(".wind-speed-select")[0]);
|
let speed = getSelected(page.querySelectorAll(".wind-speed-select")[0]);
|
||||||
|
|
||||||
let title = page.querySelectorAll(".title-select")[0].checked;
|
let title = page.querySelectorAll(".title-select")[0].checked;
|
||||||
let api_key = page.querySelectorAll(".api-key")[0];
|
|
||||||
|
|
||||||
let
|
let
|
||||||
settings = {
|
settings = {
|
||||||
temp: temp,
|
temp: temp,
|
||||||
wind_speed: speed,
|
wind_speed: speed,
|
||||||
title: title,
|
title: title,
|
||||||
api_key:api_key
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//only for daily weather
|
//only for daily weather
|
||||||
@ -1276,45 +1274,45 @@ function getWeatherSettings(page) {
|
|||||||
return settings;
|
return settings;
|
||||||
}
|
}
|
||||||
|
|
||||||
function saveWeatherAPIKey(){
|
// function saveWeatherAPIKey(){
|
||||||
let featureSelector = document.getElementById("drop");
|
// let featureSelector = document.getElementById("drop");
|
||||||
feature = getSelected(featureSelector);
|
// feature = getSelected(featureSelector);
|
||||||
let features = [
|
// let features = [
|
||||||
"Stocks",
|
// "Stocks",
|
||||||
"Crypto",
|
// "Crypto",
|
||||||
"Forex",
|
// "Forex",
|
||||||
"Current Weather",
|
// "Current Weather",
|
||||||
"Daily Forecast",
|
// "Daily Forecast",
|
||||||
"News",
|
// "News",
|
||||||
"Sports (Upcoming Games)",
|
// "Sports (Upcoming Games)",
|
||||||
"Sports (Past Games)",
|
// "Sports (Past Games)",
|
||||||
"Sports (Live Games)",
|
// "Sports (Live Games)",
|
||||||
"Sports (Team Stats)",
|
// "Sports (Team Stats)",
|
||||||
"Custom Images",
|
// "Custom Images",
|
||||||
"Custom GIFs",
|
// "Custom GIFs",
|
||||||
"Custom Messages",
|
// "Custom Messages",
|
||||||
"Commodities",
|
// "Commodities",
|
||||||
"Indices",
|
// "Indices",
|
||||||
"Movies",
|
// "Movies",
|
||||||
"IPO Calendar",
|
// "IPO Calendar",
|
||||||
];
|
// ];
|
||||||
let pageNum = features.indexOf(feature) + 1;
|
// let pageNum = features.indexOf(feature) + 1;
|
||||||
let pageSelector = "Page" + pageNum.toString();
|
// let pageSelector = "Page" + pageNum.toString();
|
||||||
|
|
||||||
let page = document.getElementById(pageSelector);
|
// let page = document.getElementById(pageSelector);
|
||||||
|
|
||||||
let api_key = page.querySelectorAll(".api-key")[0].value;
|
// let api_key = page.querySelectorAll(".api-key")[0].value;
|
||||||
let settings = {
|
// let settings = {
|
||||||
api_key:api_key
|
// api_key:api_key
|
||||||
};
|
// };
|
||||||
|
|
||||||
console.log(settings);
|
// console.log(settings);
|
||||||
|
|
||||||
fetch("/saveWeatherAPIKey", {
|
// fetch("/saveWeatherAPIKey", {
|
||||||
method: "POST",
|
// method: "POST",
|
||||||
body: JSON.stringify(settings),
|
// body: JSON.stringify(settings),
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
function saveMovieAPIKey(){
|
function saveMovieAPIKey(){
|
||||||
@ -1404,8 +1402,8 @@ ipoAPIbtn.addEventListener("click", saveIpoAPIKey);
|
|||||||
var movieAPIbtn = document.getElementById("movie-api-btn");
|
var movieAPIbtn = document.getElementById("movie-api-btn");
|
||||||
movieAPIbtn.addEventListener("click", saveMovieAPIKey);
|
movieAPIbtn.addEventListener("click", saveMovieAPIKey);
|
||||||
|
|
||||||
var weatherAPIbtn = document.getElementById("weather-api-btn");
|
// var weatherAPIbtn = document.getElementById("weather-api-btn");
|
||||||
weatherAPIbtn.addEventListener("click", saveWeatherAPIKey);
|
// weatherAPIbtn.addEventListener("click", saveWeatherAPIKey);
|
||||||
|
|
||||||
function getNewsSettings(page) {
|
function getNewsSettings(page) {
|
||||||
|
|
||||||
@ -1879,22 +1877,22 @@ function showDivTwo() {
|
|||||||
|
|
||||||
// Display message asking for restart of ticker when new API key added for weather
|
// Display message asking for restart of ticker when new API key added for weather
|
||||||
|
|
||||||
function showWeatherP() {
|
// function showWeatherP() {
|
||||||
if(document.getElementById("api-key1").value==="") {
|
// if(document.getElementById("api-key1").value==="") {
|
||||||
|
|
||||||
document.getElementById('weather-api-p').style.display = "none";
|
// document.getElementById('weather-api-p').style.display = "none";
|
||||||
}
|
// }
|
||||||
|
|
||||||
else if (document.getElementById("api-key1").value==="Weather API Key") {
|
// else if (document.getElementById("api-key1").value==="Weather API Key") {
|
||||||
document.getElementById('weather-api-p').style.display = "none";
|
// document.getElementById('weather-api-p').style.display = "none";
|
||||||
|
|
||||||
}
|
// }
|
||||||
|
|
||||||
else {
|
// else {
|
||||||
document.getElementById('weather-api-p').style.display = "block"
|
// document.getElementById('weather-api-p').style.display = "block"
|
||||||
}
|
// }
|
||||||
|
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
// Display message asking for restart of ticker when new API key added for movie
|
// Display message asking for restart of ticker when new API key added for movie
|
||||||
@ -1939,32 +1937,32 @@ function showIpoP() {
|
|||||||
// Disable adding cities when no API key detected
|
// Disable adding cities when no API key detected
|
||||||
|
|
||||||
|
|
||||||
if(document.getElementById("api-key1").value==="") {
|
// if(document.getElementById("api-key1").value==="") {
|
||||||
document.getElementById('inputTextBtn6').disabled = true;
|
// document.getElementById('inputTextBtn6').disabled = true;
|
||||||
}
|
// }
|
||||||
|
|
||||||
else if (document.getElementById("api-key1").value==="Weather API Key") {
|
// else if (document.getElementById("api-key1").value==="Weather API Key") {
|
||||||
document.getElementById('inputTextBtn6').disabled = true;
|
// document.getElementById('inputTextBtn6').disabled = true;
|
||||||
}
|
// }
|
||||||
|
|
||||||
else {
|
// else {
|
||||||
document.getElementById('inputTextBtn6').disabled = false;
|
// document.getElementById('inputTextBtn6').disabled = false;
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(document.getElementById("api-key").value==="") {
|
// if(document.getElementById("api-key").value==="") {
|
||||||
document.getElementById('inputTextBtn7').disabled = true;
|
// document.getElementById('inputTextBtn7').disabled = true;
|
||||||
}
|
// }
|
||||||
|
|
||||||
else if (document.getElementById("api-key").value==="Weather API Key") {
|
// else if (document.getElementById("api-key").value==="Weather API Key") {
|
||||||
document.getElementById('inputTextBtn7').disabled = true;
|
// document.getElementById('inputTextBtn7').disabled = true;
|
||||||
}
|
// }
|
||||||
|
|
||||||
else {
|
// else {
|
||||||
document.getElementById('inputTextBtn7').disabled = false;
|
// document.getElementById('inputTextBtn7').disabled = false;
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
// Stocks validation
|
// Stocks validation
|
||||||
@ -2695,3 +2693,13 @@ function saveSchedulerSettings() {
|
|||||||
document.getElementById('saved').style.display = "block";
|
document.getElementById('saved').style.display = "block";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// CHANGE TOP 20 OR TOP 10 WORLD GOLF RANKING
|
||||||
|
function setTop20() {
|
||||||
|
let top20 = document.getElementById("golf-ranking-number").value;
|
||||||
|
fetch("/setTop20or10", {
|
||||||
|
method: "POST",
|
||||||
|
body: JSON.stringify(top20),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
1232
stockTicker.py
1232
stockTicker.py
File diff suppressed because it is too large
Load Diff
@ -1,73 +1,45 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
|
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
|
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
|
|
||||||
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
|
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
|
||||||
|
|
||||||
<meta http-equiv="Pragma" content="no-cache" />
|
<meta http-equiv="Pragma" content="no-cache" />
|
||||||
|
|
||||||
<meta http-equiv="Expires" content="0" />
|
<meta http-equiv="Expires" content="0" />
|
||||||
|
|
||||||
<title>Fintic - Web Control Panel</title>
|
<title>Fintic - Web Control Panel</title>
|
||||||
|
|
||||||
<link rel="icon" type="image/png" href="/static/images/favicon.png">
|
<link rel="icon" type="image/png" href="/static/images/favicon.png">
|
||||||
|
|
||||||
<!-- Bootstrap 5 CDN Links -->
|
<!-- Bootstrap 5 CDN Links -->
|
||||||
|
|
||||||
<script
|
<script
|
||||||
|
|
||||||
src="{{ url_for('static', filename='bootstrap/js/bootstrap.bundle.min.js') }}"
|
src="{{ url_for('static', filename='bootstrap/js/bootstrap.bundle.min.js') }}"
|
||||||
|
|
||||||
></script>
|
></script>
|
||||||
|
|
||||||
<link
|
<link
|
||||||
|
|
||||||
href="{{ url_for('static', filename='bootstrap/css/bootstrap.min.css') }}"
|
href="{{ url_for('static', filename='bootstrap/css/bootstrap.min.css') }}"
|
||||||
|
|
||||||
rel="stylesheet"
|
rel="stylesheet"
|
||||||
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Fontawesome - for icons -->
|
<!-- Fontawesome - for icons -->
|
||||||
|
|
||||||
<link
|
<link
|
||||||
|
|
||||||
rel="stylesheet"
|
rel="stylesheet"
|
||||||
|
|
||||||
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/css/all.min.css"
|
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/css/all.min.css"
|
||||||
|
|
||||||
integrity="sha512-+4zCK9k+qNFUR5X+cKL9EIR+ZOhtIloNl9GIKS57V1MyNsYpYcUrUeQc9vNfzsWfV28IaLL3i96P9sdNyeRssA=="
|
integrity="sha512-+4zCK9k+qNFUR5X+cKL9EIR+ZOhtIloNl9GIKS57V1MyNsYpYcUrUeQc9vNfzsWfV28IaLL3i96P9sdNyeRssA=="
|
||||||
|
|
||||||
crossorigin="anonymous"
|
crossorigin="anonymous"
|
||||||
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<link
|
<link
|
||||||
|
|
||||||
rel="stylesheet"
|
rel="stylesheet"
|
||||||
|
|
||||||
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/css/fontawesome.min.css"
|
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/css/fontawesome.min.css"
|
||||||
|
|
||||||
integrity="sha512-kJ30H6g4NGhWopgdseRb8wTsyllFUYIx3hiUwmGAkgA9B/JbzUBDQVr2VVlWGde6sdBVOG7oU8AL35ORDuMm8g=="
|
integrity="sha512-kJ30H6g4NGhWopgdseRb8wTsyllFUYIx3hiUwmGAkgA9B/JbzUBDQVr2VVlWGde6sdBVOG7oU8AL35ORDuMm8g=="
|
||||||
|
|
||||||
crossorigin="anonymous"
|
crossorigin="anonymous"
|
||||||
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- CSS Stylesheet linking -->
|
<!-- CSS Stylesheet linking -->
|
||||||
|
|
||||||
<!-- <link href="{{ url_for('static', filename='style.css') }}" type="text/css" rel="stylesheet" /> ALWAYS CHANGE VERSIONING WHENEVER CHANGES ARE MADE TO AVOID BAD CACHING -->
|
<!-- <link href="{{ url_for('static', filename='style.css') }}" type="text/css" rel="stylesheet" /> ALWAYS CHANGE VERSIONING WHENEVER CHANGES ARE MADE TO AVOID BAD CACHING -->
|
||||||
<link rel="stylesheet" type="text/css" href="../static/style.css?ver=1.3.4"/>
|
<link rel="stylesheet" type="text/css" href="../static/style.css?ver=1.3.5"/>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
@ -127,7 +99,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<p class="text-white" id="version-text">Version 1.3.4</p>
|
<p class="text-white" id="version-text">Version 1.3.5</p>
|
||||||
<p class="text-white" id="version-text"><a href="https://docs.google.com/document/d/1TzvukZv_0Pd3TUM6Xe2wEkymn9uIT2qXUBFnMCQwp5g/edit?usp=sharing" target="_blank" id="footerlinks">Changelog</a></p>
|
<p class="text-white" id="version-text"><a href="https://docs.google.com/document/d/1TzvukZv_0Pd3TUM6Xe2wEkymn9uIT2qXUBFnMCQwp5g/edit?usp=sharing" target="_blank" id="footerlinks">Changelog</a></p>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
@ -4054,43 +4026,25 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="row g-3 align-items-center mt-3">
|
<!-- <div class="row g-3 align-items-center mt-3">
|
||||||
|
|
||||||
<div class="col-auto">
|
<div class="col-auto">
|
||||||
|
|
||||||
<label for="inputText" class="col-form-label">API Key: </label>
|
<label for="inputText" class="col-form-label">API Key: </label>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-auto">
|
<div class="col-auto">
|
||||||
|
|
||||||
<input
|
<input
|
||||||
|
|
||||||
type="text"
|
type="text"
|
||||||
|
|
||||||
id="api-key1"
|
id="api-key1"
|
||||||
|
|
||||||
placeholder="Weather API Key"
|
placeholder="Weather API Key"
|
||||||
|
|
||||||
class="form-control api-key"
|
class="form-control api-key"
|
||||||
|
|
||||||
aria-describedby="TextHelpInline"
|
aria-describedby="TextHelpInline"
|
||||||
|
|
||||||
value="{{ api_keys }}"
|
value="{{ api_keys }}"
|
||||||
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-auto">
|
<div class="col-auto">
|
||||||
|
|
||||||
<button id="weather-api-btn" class="btn set-btn" onClick="showWeatherP()">Add</button>
|
<button id="weather-api-btn" class="btn set-btn" onClick="showWeatherP()">Add</button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p id="weather-api-p" style="display: none">New weather API key detected, please restart the ticker in order for the feature to work properly.</p>
|
<p id="weather-api-p" style="display: none">New weather API key detected, please restart the ticker in order for the feature to work properly.</p>
|
||||||
|
</div> -->
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -4510,41 +4464,23 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row g-3 align-items-center mt-3">
|
<!-- <div class="row g-3 align-items-center mt-3">
|
||||||
|
|
||||||
<div class="col-auto">
|
<div class="col-auto">
|
||||||
|
|
||||||
<label for="inputText" class="col-form-label">API Key: </label>
|
<label for="inputText" class="col-form-label">API Key: </label>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-auto">
|
<div class="col-auto">
|
||||||
|
|
||||||
<input
|
<input
|
||||||
|
|
||||||
type="text"
|
type="text"
|
||||||
|
|
||||||
id="api-key"
|
id="api-key"
|
||||||
|
|
||||||
placeholder="Weather API Key"
|
placeholder="Weather API Key"
|
||||||
|
|
||||||
class="form-control api-key"
|
class="form-control api-key"
|
||||||
|
|
||||||
aria-describedby="TextHelpInline"
|
aria-describedby="TextHelpInline"
|
||||||
|
|
||||||
value="{{ api_keys }}"
|
value="{{ api_keys }}"
|
||||||
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-auto">
|
<div class="col-auto">
|
||||||
|
|
||||||
<!-- <button id="weather-api-btn" class="btn set-btn">Add</button> -->
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
</div> -->
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -6181,17 +6117,10 @@
|
|||||||
<div class="col-auto">
|
<div class="col-auto">
|
||||||
|
|
||||||
<select
|
<select
|
||||||
|
|
||||||
id="inputScrollSpeedRow10"
|
id="inputScrollSpeedRow10"
|
||||||
|
class="form-select speed-select">
|
||||||
class="form-select speed-select"
|
|
||||||
|
|
||||||
>
|
|
||||||
|
|
||||||
<option {%if team_stats.speed2 == 'medium' %} selected {% endif %}>Medium</option>
|
<option {%if team_stats.speed2 == 'medium' %} selected {% endif %}>Medium</option>
|
||||||
|
|
||||||
<option {%if team_stats.speed2 == 'slow' %} selected {% endif %}>Slow</option>
|
<option {%if team_stats.speed2 == 'slow' %} selected {% endif %}>Slow</option>
|
||||||
|
|
||||||
<option {%if team_stats.speed2 == 'fast' %} selected {% endif %}>Fast</option>
|
<option {%if team_stats.speed2 == 'fast' %} selected {% endif %}>Fast</option>
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
@ -6220,14 +6149,10 @@
|
|||||||
|
|
||||||
id="inputTransition10"
|
id="inputTransition10"
|
||||||
|
|
||||||
class="form-select animation-select"
|
class="form-select animation-select">
|
||||||
|
|
||||||
>
|
|
||||||
|
|
||||||
<option {%if team_stats.animation == 'down' %} selected {% endif %}>Down</option>
|
<option {%if team_stats.animation == 'down' %} selected {% endif %}>Down</option>
|
||||||
|
|
||||||
<option {%if team_stats.animation == 'up' %} selected {% endif %}>Up</option>
|
<option {%if team_stats.animation == 'up' %} selected {% endif %}>Up</option>
|
||||||
|
|
||||||
<option {%if team_stats.animation == 'continuous' %} selected {% endif %}>Continuous</option>
|
<option {%if team_stats.animation == 'continuous' %} selected {% endif %}>Continuous</option>
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
@ -6239,51 +6164,54 @@
|
|||||||
|
|
||||||
|
|
||||||
<div class="row g-3 align-items-center mt-3">
|
<div class="row g-3 align-items-center mt-3">
|
||||||
|
|
||||||
<div class="col-auto">
|
<div class="col-auto">
|
||||||
|
|
||||||
<label for="inputTransition103Z" class="col-form-label"
|
<label for="inputTransition103Z" class="col-form-label"
|
||||||
|
|
||||||
>Sport League:
|
>Sport League:
|
||||||
|
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-auto">
|
<div class="col-auto">
|
||||||
|
|
||||||
<select id="inputTransition103" class="form-select">
|
<select id="inputTransition103" class="form-select">
|
||||||
|
|
||||||
<option>NFL</option>
|
<option>NFL</option>
|
||||||
|
|
||||||
<option>NBA</option>
|
<option>NBA</option>
|
||||||
|
|
||||||
<option>NHL</option>
|
<option>NHL</option>
|
||||||
|
|
||||||
<option>PREMIERLEAGUE</option>
|
<option>PREMIERLEAGUE</option>
|
||||||
|
|
||||||
<option>MLB</option>
|
<option>MLB</option>
|
||||||
|
|
||||||
<option>MLS</option>
|
<option>MLS</option>
|
||||||
|
<option>PGA</option>
|
||||||
|
<option>LPGA</option>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-auto">
|
<div class="col-auto">
|
||||||
|
|
||||||
<button id="inputTransitionBtn103" class="btn set-btn">
|
<button id="inputTransitionBtn103" class="btn set-btn">
|
||||||
|
|
||||||
Add
|
Add
|
||||||
|
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="row g-3 align-items-center mt-3">
|
||||||
|
<div class="col-auto">
|
||||||
|
<label for="inputTransition103Z" class="col-form-label"
|
||||||
|
>Golf Rankings:
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div class="col-auto">
|
||||||
|
<select id="golf-ranking-number" class="form-select">
|
||||||
|
<option {%if team_stats.top20 == 20 %} selected {% endif %}>Top 20</option>
|
||||||
|
<option {%if team_stats.top20 == 10 %} selected {% endif %}>Top 10</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="col-auto">
|
||||||
|
<button id="golf-ranking-set" class="btn set-btn" onclick="setTop20()">
|
||||||
|
Set
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="row g-3 align-items-center mt-3">
|
<div class="row g-3 align-items-center mt-3">
|
||||||
|
|
||||||
<div class="col-auto">
|
<div class="col-auto">
|
||||||
@ -6308,14 +6236,8 @@
|
|||||||
|
|
||||||
id="flexCheckChecked24"
|
id="flexCheckChecked24"
|
||||||
|
|
||||||
{%
|
{% if team_stats.title%}
|
||||||
|
|
||||||
if
|
|
||||||
|
|
||||||
team_stats.title%}
|
|
||||||
|
|
||||||
checked
|
checked
|
||||||
|
|
||||||
{%endif%}
|
{%endif%}
|
||||||
|
|
||||||
/>
|
/>
|
||||||
@ -8531,7 +8453,7 @@
|
|||||||
|
|
||||||
<p>© 2020-2023 Fintic Limited., All Rights Reserved. <a href="mailto:info@fintic.io" id="footerlinks">Contact Us.</a></p>
|
<p>© 2020-2023 Fintic Limited., All Rights Reserved. <a href="mailto:info@fintic.io" id="footerlinks">Contact Us.</a></p>
|
||||||
|
|
||||||
<p>Data Provided by IEX Cloud, Openweathermap, CoinGecko, Exchangerate-API, TheSportsDB, Google News, Yahoo Finance, ESPN, The Movie DB, Finnhub</p>
|
<p>Data Provided by IEX Cloud, Open-Meteo, CoinGecko, Exchangerate-API, TheSportsDB, Google News, Yahoo Finance, ESPN, The Movie DB, Finnhub</p>
|
||||||
|
|
||||||
<p>Useful resources: <a href="https://www.youtube.com/playlist?list=PLf8pW0bNjnebNZh3y0AsY18sxJj6IhAsv" id="footerlinks" target="_blank">YouTube Tutorials</a> , <a href="https://docs.google.com/spreadsheets/d/1IZkEl49j97xvG8jcEdWc5XdOLOUb_-ZLVHle2vezWCc/edit?usp=sharing" id="footerlinks" target="_blank">Formatting Guide & Info</a> , <a href="https://fintic.io" id="footerlinks" target="_blank">Official Website</a></p>
|
<p>Useful resources: <a href="https://www.youtube.com/playlist?list=PLf8pW0bNjnebNZh3y0AsY18sxJj6IhAsv" id="footerlinks" target="_blank">YouTube Tutorials</a> , <a href="https://docs.google.com/spreadsheets/d/1IZkEl49j97xvG8jcEdWc5XdOLOUb_-ZLVHle2vezWCc/edit?usp=sharing" id="footerlinks" target="_blank">Formatting Guide & Info</a> , <a href="https://fintic.io" id="footerlinks" target="_blank">Official Website</a></p>
|
||||||
|
|
||||||
@ -8545,7 +8467,7 @@
|
|||||||
<script src="{{ url_for('static', filename='js/jquery-2.1.1.js') }}"></script>
|
<script src="{{ url_for('static', filename='js/jquery-2.1.1.js') }}"></script>
|
||||||
|
|
||||||
<!-- <script src="{{ url_for('static', filename='app.js') }}"></script>. ALWAYS CHANGE VERSIONING WHENEVER CHANGES ARE MADE TO AVOID BAD CACHING -->
|
<!-- <script src="{{ url_for('static', filename='app.js') }}"></script>. ALWAYS CHANGE VERSIONING WHENEVER CHANGES ARE MADE TO AVOID BAD CACHING -->
|
||||||
<script type='text/javascript' src='../static/app.js?ver=1.3.4'></script>
|
<script type='text/javascript' src='../static/app.js?ver=1.3.5'></script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user