@ -1,7 +1,19 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
sleep 80
|
sleep 120
|
||||||
|
|
||||||
|
internet="offline"
|
||||||
|
|
||||||
|
wget -q --spider http://google.com
|
||||||
|
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
|
internet="online"
|
||||||
|
else
|
||||||
|
internet="offline"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
if [[ $internet = "online" ]]; then
|
||||||
value=$(<csv/system_info.json)
|
value=$(<csv/system_info.json)
|
||||||
echo "${value}"
|
echo "${value}"
|
||||||
|
|
||||||
@ -38,6 +50,6 @@ echo "$str" >> csv/system_info.json
|
|||||||
|
|
||||||
sudo chmod 777 csv/system_info.json
|
sudo chmod 777 csv/system_info.json
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
1
csv/indices_settings.json
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"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"}}}
|
@ -1 +1 @@
|
|||||||
{"stocks": {"time": "14/06/2022 06:42:06", "force": false}, "crypto": {"time": "14/06/2022 06:58:18", "force": false}, "news": {"time": "14/06/2022 05:29:08", "force": false}, "weather": {"time": "14/06/2022 05:29:08", "force": false}, "forex": {"time": "14/06/2022 05:29:14", "force": false}, "sports_l": {"time": "14/06/2022 04:42:37", "force": false}, "sports_p": {"time": "14/06/2022 06:27:34", "force": false}, "sports_u": {"time": "14/06/2022 06:28:34", "force": false}, "sports_t": {"time": "14/06/2022 06:26:23", "force": false}, "commodities": {"time": "14/06/2022 06:51:07", "force": false}}
|
{"stocks": {"time": "14/06/2022 06:42:06", "force": false}, "crypto": {"time": "14/06/2022 06:58:18", "force": false}, "news": {"time": "14/06/2022 05:29:08", "force": false}, "weather": {"time": "14/06/2022 05:29:08", "force": false}, "forex": {"time": "14/06/2022 05:29:14", "force": false}, "sports_l": {"time": "14/06/2022 04:42:37", "force": false}, "sports_p": {"time": "14/06/2022 06:27:34", "force": false}, "sports_u": {"time": "14/06/2022 06:28:34", "force": false}, "sports_t": {"time": "14/06/2022 06:26:23", "force": false}, "commodities": {"time": "14/06/2022 06:51:07", "force": false}, "indices": {"time": "05/10/2022 04:06:10", "force": false}}
|
||||||
|
@ -10,12 +10,15 @@ Everton,133615,EVE,Blue,Everton.png
|
|||||||
Leeds,133635,LEE,Yellow,Leeds.png
|
Leeds,133635,LEE,Yellow,Leeds.png
|
||||||
Leicester,133626,LEI,Blue,Leicester.png
|
Leicester,133626,LEI,Blue,Leicester.png
|
||||||
Liverpool,133602,LIV,Red,Liverpool.png
|
Liverpool,133602,LIV,Red,Liverpool.png
|
||||||
Man City,133613,MCI,Blue,Manchester City.png
|
Manchester City,133613,MCI,Blue,Manchester City.png
|
||||||
Man United,133612,MUN,Red,Man United.png
|
Manchester United,133612,MUN,Red,Man United.png
|
||||||
Newcastle,134777,NEW,Light blue,Newcastle.png
|
Newcastle,134777,NEW,Light blue,Newcastle.png
|
||||||
Norwich,133608,NOR,Green,Norwich.png
|
Norwich,133608,NOR,Green,Norwich.png
|
||||||
Southampton,134778,SOU,Red,Southampton.png
|
Southampton,134778,SOU,Red,Southampton.png
|
||||||
Tottenham,133616,TOT,Dark blue,Tottenham.png
|
Tottenham,133616,TOT,Dark blue,Tottenham.png
|
||||||
Watford,133624,WAT,Red,Watford.png
|
Watford,133624,WAT,Red,Watford.png
|
||||||
West Ham,133636,WHU,Red,West Ham.png
|
West Ham,133636,WHU,Red,West Ham.png
|
||||||
Wolves,133599,WOL,Yellow,Wolves.png
|
Wolves,133599,WOL,Yellow,Wolves.png
|
||||||
|
Fulham,133600,FUL,Red,Fulham.png
|
||||||
|
Nottingham Forest,133720,FOR,Red,Nottingham Forest.png
|
||||||
|
Bournemouth,134301,BOU,Red,Bournemouth.png
|
||||||
|
|
@ -20,6 +20,20 @@ import traceback
|
|||||||
from geopy import geocoders
|
from geopy import geocoders
|
||||||
from multiprocessing import Process
|
from multiprocessing import Process
|
||||||
|
|
||||||
|
try:
|
||||||
|
time.sleep(80)
|
||||||
|
f = open('csv/last_updates.json', 'r')
|
||||||
|
last_updates = json.load(f)
|
||||||
|
f.close()
|
||||||
|
last_updates['stocks']['force'] = True
|
||||||
|
#last_updates['weather']['force'] = True
|
||||||
|
f = open('csv/last_updates.json', 'w')
|
||||||
|
json.dump(last_updates, f)
|
||||||
|
f.close()
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
def getInput(Block=False):
|
def getInput(Block=False):
|
||||||
if Block or select.select([sys.stdin], [], [], 0) == ([sys.stdin], [], []):
|
if Block or select.select([sys.stdin], [], [], 0) == ([sys.stdin], [], []):
|
||||||
msg = sys.stdin.read(1)
|
msg = sys.stdin.read(1)
|
||||||
@ -68,7 +82,7 @@ def updateStocks(api_key, logf):
|
|||||||
data = response.json()
|
data = response.json()
|
||||||
|
|
||||||
|
|
||||||
stock_info = {}
|
# stock_info = {}
|
||||||
if len(data) > 0:
|
if len(data) > 0:
|
||||||
for symbol in symbols:
|
for symbol in symbols:
|
||||||
for stock in data:
|
for stock in data:
|
||||||
@ -83,17 +97,18 @@ def updateStocks(api_key, logf):
|
|||||||
json.dump(all_stocks_settings, f)
|
json.dump(all_stocks_settings, f)
|
||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
except Exception as e:
|
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]
|
||||||
logf.write(str(e))
|
#logf.write(str(e))
|
||||||
logf.write('. file: ' + fname)
|
#logf.write('. file: ' + fname)
|
||||||
logf.write('. line: ' + str(exc_tb.tb_lineno))
|
#logf.write('. line: ' + str(exc_tb.tb_lineno))
|
||||||
logf.write('. type: ' + str(exc_type))
|
#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.write('\n ' + "".join(traceback.format_exception(sys.exc_info()[0], sys.exc_info()[1], sys.exc_info()[2])))
|
||||||
logf.close()
|
#logf.close()
|
||||||
|
|
||||||
def updateCommodities(api_key, logf):
|
def updateCommodities(api_key, logf):
|
||||||
|
|
||||||
@ -128,18 +143,68 @@ def updateCommodities(api_key, logf):
|
|||||||
json.dump(all_commodities_settings, f)
|
json.dump(all_commodities_settings, f)
|
||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
except Exception as e:
|
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]
|
||||||
logf.write(str(e))
|
#logf.write(str(e))
|
||||||
logf.write('. file: ' + fname)
|
#logf.write('. file: ' + fname)
|
||||||
logf.write('. line: ' + str(exc_tb.tb_lineno))
|
#logf.write('. line: ' + str(exc_tb.tb_lineno))
|
||||||
logf.write('. type: ' + str(exc_type))
|
#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.write('\n ' + "".join(traceback.format_exception(sys.exc_info()[0], sys.exc_info()[1], sys.exc_info()[2])))
|
||||||
logf.close()
|
#logf.close()
|
||||||
|
|
||||||
|
|
||||||
|
def updateIndices(api_key, logf):
|
||||||
|
|
||||||
|
try:
|
||||||
|
|
||||||
|
f = open('csv/indices_settings.json', 'r')
|
||||||
|
all_indices_settings = json.load(f)
|
||||||
|
f.close()
|
||||||
|
|
||||||
|
index_info = all_indices_settings['symbols']
|
||||||
|
symbols = list(index_info.keys())
|
||||||
|
|
||||||
|
url = 'https://bm7p954xoh.execute-api.us-east-2.amazonaws.com/default/ScriptsAPI/indices?symbols='
|
||||||
|
|
||||||
|
for symbol in symbols:
|
||||||
|
url += symbol + ','
|
||||||
|
|
||||||
|
url += '&apiKey=' + api_key
|
||||||
|
response = requests.get(url)
|
||||||
|
data = response.json()
|
||||||
|
|
||||||
|
|
||||||
|
index_info = {}
|
||||||
|
if len(data) > 0:
|
||||||
|
for symbol in symbols:
|
||||||
|
for index in data:
|
||||||
|
if index['symbol'] == symbol:
|
||||||
|
index_info[index['symbol']] = {'name': index['name'], 'current': index['price'], 'point_change': index['change'], 'percent_change': index['percent_change']}
|
||||||
|
|
||||||
|
all_indices_settings['symbols'] = index_info
|
||||||
|
f = open('csv/indices_settings.json', 'w+')
|
||||||
|
json.dump(all_indices_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 updateCrypto(api_key, logf):
|
def updateCrypto(api_key, logf):
|
||||||
|
|
||||||
|
|
||||||
@ -187,17 +252,18 @@ def updateCrypto(api_key, logf):
|
|||||||
json.dump(all_crypto_settings, f)
|
json.dump(all_crypto_settings, f)
|
||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
except Exception as e:
|
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]
|
||||||
logf.write(str(e))
|
#logf.write(str(e))
|
||||||
logf.write('. file: ' + fname)
|
#logf.write('. file: ' + fname)
|
||||||
logf.write('. line: ' + str(exc_tb.tb_lineno))
|
#logf.write('. line: ' + str(exc_tb.tb_lineno))
|
||||||
logf.write('. type: ' + str(exc_type))
|
#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.write('\n ' + "".join(traceback.format_exception(sys.exc_info()[0], sys.exc_info()[1], sys.exc_info()[2])))
|
||||||
logf.close()
|
#logf.close()
|
||||||
|
|
||||||
def updateForex(api_key, logf):
|
def updateForex(api_key, logf):
|
||||||
|
|
||||||
@ -246,17 +312,17 @@ def updateForex(api_key, logf):
|
|||||||
f = open( "csv/forex_settings.json", 'w+' )
|
f = open( "csv/forex_settings.json", 'w+' )
|
||||||
json.dump(all_forex_settings, f)
|
json.dump(all_forex_settings, f)
|
||||||
f.close()
|
f.close()
|
||||||
except Exception as e:
|
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]
|
||||||
logf.write(str(e))
|
#logf.write(str(e))
|
||||||
logf.write('. file: ' + fname)
|
#logf.write('. file: ' + fname)
|
||||||
logf.write('. line: ' + str(exc_tb.tb_lineno))
|
#logf.write('. line: ' + str(exc_tb.tb_lineno))
|
||||||
logf.write('. type: ' + str(exc_type))
|
#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.write('\n ' + "".join(traceback.format_exception(sys.exc_info()[0], sys.exc_info()[1], sys.exc_info()[2])))
|
||||||
logf.close()
|
#logf.close()
|
||||||
|
|
||||||
|
|
||||||
def updateNews(api_key, logf):
|
def updateNews(api_key, logf):
|
||||||
@ -309,17 +375,18 @@ def updateNews(api_key, logf):
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
except Exception as e:
|
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]
|
||||||
logf.write(str(e))
|
#logf.write(str(e))
|
||||||
logf.write('. file: ' + fname)
|
#logf.write('. file: ' + fname)
|
||||||
logf.write('. line: ' + str(exc_tb.tb_lineno))
|
#logf.write('. line: ' + str(exc_tb.tb_lineno))
|
||||||
logf.write('. type: ' + str(exc_type))
|
#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.write('\n ' + "".join(traceback.format_exception(sys.exc_info()[0], sys.exc_info()[1], sys.exc_info()[2])))
|
||||||
logf.close()
|
#logf.close()
|
||||||
|
|
||||||
|
|
||||||
def updateWeather(api_key, logf):
|
def updateWeather(api_key, logf):
|
||||||
@ -416,17 +483,18 @@ def updateWeather(api_key, logf):
|
|||||||
json.dump( all_daily_settings, f)
|
json.dump( all_daily_settings, f)
|
||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
except Exception as e:
|
except:
|
||||||
logf = open('log.txt', "a")
|
pass
|
||||||
exc_type, exc_obj, exc_tb = sys.exc_info()
|
#logf = open('log.txt', "a")
|
||||||
fname = os.path.split(exc_tb.tb_frame.f_code.co_filename)[1]
|
#exc_type, exc_obj, exc_tb = sys.exc_info()
|
||||||
logf.write(str(e))
|
#fname = os.path.split(exc_tb.tb_frame.f_code.co_filename)[1]
|
||||||
logf.write('. file: ' + fname)
|
#logf.write(str(e))
|
||||||
logf.write('. line: ' + str(exc_tb.tb_lineno))
|
#logf.write('. file: ' + fname)
|
||||||
logf.write('. type: ' + str(exc_type))
|
#logf.write('. line: ' + str(exc_tb.tb_lineno))
|
||||||
logf.write('\n ' + "".join(traceback.format_exception(sys.exc_info()[0], sys.exc_info()[1], sys.exc_info()[2])))
|
#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()
|
#logf.close()
|
||||||
|
|
||||||
|
|
||||||
def updateLeagueTables(api_key, logf):
|
def updateLeagueTables(api_key, logf):
|
||||||
@ -484,17 +552,18 @@ def updateLeagueTables(api_key, logf):
|
|||||||
json.dump(all_settings, f)
|
json.dump(all_settings, f)
|
||||||
|
|
||||||
f.close()
|
f.close()
|
||||||
except Exception as e:
|
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]
|
||||||
logf.write(str(e))
|
#logf.write(str(e))
|
||||||
logf.write('. file: ' + fname)
|
#logf.write('. file: ' + fname)
|
||||||
logf.write('. line: ' + str(exc_tb.tb_lineno))
|
#logf.write('. line: ' + str(exc_tb.tb_lineno))
|
||||||
logf.write('. type: ' + str(exc_type))
|
#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.write('\n ' + "".join(traceback.format_exception(sys.exc_info()[0], sys.exc_info()[1], sys.exc_info()[2])))
|
||||||
logf.close()
|
#logf.close()
|
||||||
|
|
||||||
|
|
||||||
def updateLeagueEvents(api_key, time, logf):
|
def updateLeagueEvents(api_key, time, logf):
|
||||||
@ -562,16 +631,17 @@ def updateLeagueEvents(api_key, time, logf):
|
|||||||
f = open( "csv/{}_games.json".format(time), 'w+' )
|
f = open( "csv/{}_games.json".format(time), 'w+' )
|
||||||
json.dump(all_settings, f)
|
json.dump(all_settings, f)
|
||||||
f.close()
|
f.close()
|
||||||
except Exception as e:
|
except:
|
||||||
logf = open('log.txt', "a")
|
pass
|
||||||
exc_type, exc_obj, exc_tb = sys.exc_info()
|
#logf = open('log.txt', "a")
|
||||||
fname = os.path.split(exc_tb.tb_frame.f_code.co_filename)[1]
|
#exc_type, exc_obj, exc_tb = sys.exc_info()
|
||||||
logf.write(str(e))
|
#fname = os.path.split(exc_tb.tb_frame.f_code.co_filename)[1]
|
||||||
logf.write('. file: ' + fname)
|
#logf.write(str(e))
|
||||||
logf.write('. line: ' + str(exc_tb.tb_lineno))
|
#logf.write('. file: ' + fname)
|
||||||
logf.write('. type: ' + str(exc_type))
|
#logf.write('. line: ' + str(exc_tb.tb_lineno))
|
||||||
logf.write('\n ' + "".join(traceback.format_exception(sys.exc_info()[0], sys.exc_info()[1], sys.exc_info()[2])))
|
#logf.write('. type: ' + str(exc_type))
|
||||||
logf.close()
|
#logf.write('\n ' + "".join(traceback.format_exception(sys.exc_info()[0], sys.exc_info()[1], sys.exc_info()[2])))
|
||||||
|
#logf.close()
|
||||||
|
|
||||||
|
|
||||||
def updateSports(api_key, logf):
|
def updateSports(api_key, logf):
|
||||||
@ -651,7 +721,7 @@ if __name__ == '__main__':
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
update_frequencies = {'stocks':2, 'crypto':5, 'forex':60, 'news':120, 'weather': 120, 'sports': 1440, 'commodities': 15} #minutes
|
update_frequencies = {'stocks':2, 'crypto':5, 'forex':60, 'news':120, 'weather': 120, 'sports': 1440, 'commodities': 15, 'indices': 15} #minutes
|
||||||
|
|
||||||
NY_zone = pytz.timezone('America/New_York')
|
NY_zone = pytz.timezone('America/New_York')
|
||||||
CET_zone = pytz.timezone('EST')
|
CET_zone = pytz.timezone('EST')
|
||||||
@ -694,18 +764,18 @@ if __name__ == '__main__':
|
|||||||
t = time.time()
|
t = time.time()
|
||||||
update_processes = []
|
update_processes = []
|
||||||
|
|
||||||
try:
|
# try:
|
||||||
time.sleep(60)
|
# time.sleep(60)
|
||||||
f = open('csv/last_updates.json', 'r')
|
# f = open('csv/last_updates.json', 'r')
|
||||||
last_updates = json.load(f)
|
# last_updates = json.load(f)
|
||||||
f.close()
|
# f.close()
|
||||||
last_updates['stocks']['force'] = True
|
# last_updates['stocks']['force'] = True
|
||||||
#last_updates['weather']['force'] = True
|
# #last_updates['weather']['force'] = True
|
||||||
f = open('csv/last_updates.json', 'w')
|
# f = open('csv/last_updates.json', 'w')
|
||||||
json.dump(last_updates, f)
|
# json.dump(last_updates, f)
|
||||||
f.close()
|
# f.close()
|
||||||
except:
|
# except:
|
||||||
pass
|
# pass
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -722,7 +792,7 @@ if __name__ == '__main__':
|
|||||||
"news": {"time": "06/03/2022 04:07:09", "force": True}, "weather": {"time": "06/03/2022 04:08:20", "force": True},
|
"news": {"time": "06/03/2022 04:07:09", "force": True}, "weather": {"time": "06/03/2022 04:08:20", "force": True},
|
||||||
"forex": {"time": "06/03/2022 03:54:02", "force": True}, "sports_l": {"time": "06/03/2022 04:10:09", "force": True},
|
"forex": {"time": "06/03/2022 03:54:02", "force": True}, "sports_l": {"time": "06/03/2022 04:10:09", "force": True},
|
||||||
"sports_p": {"time": "06/03/2022 04:10:09", "force": True},
|
"sports_p": {"time": "06/03/2022 04:10:09", "force": True},
|
||||||
"sports_u": {"time": "06/03/2022 04:10:09", "force": True},"sports_t": {"time": "06/03/2022 04:10:09", "force": True}, "commodities": {"time": "06/03/2022 04:10:09", "force": True}}
|
"sports_u": {"time": "06/03/2022 04:10:09", "force": True},"sports_t": {"time": "06/03/2022 04:10:09", "force": True}, "commodities": {"time": "06/03/2022 04:10:09", "force": True}, "indices": {"time": "06/03/2022 04:10:09", "force": True}}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -791,7 +861,24 @@ if __name__ == '__main__':
|
|||||||
update_process = Process(target = updateCommodities, args = (api_key,logf))
|
update_process = Process(target = updateCommodities, args = (api_key,logf))
|
||||||
update_process.start()
|
update_process.start()
|
||||||
update_processes.append(update_process)
|
update_processes.append(update_process)
|
||||||
|
|
||||||
|
# indices
|
||||||
|
indices_time = datetime.strptime(last_updates['indices']['time'], "%d/%m/%Y %H:%M:%S")
|
||||||
|
|
||||||
|
|
||||||
|
NY_time = datetime.now(NY_zone).replace(tzinfo=None)
|
||||||
|
diff = (NY_time - indices_time).total_seconds()/60 #minutes
|
||||||
|
|
||||||
|
|
||||||
|
if last_updates['indices']['force'] or diff >= update_frequencies['indices']:# or msg == 'c':
|
||||||
|
indices_time = NY_time.strftime("%d/%m/%Y %H:%M:%S")
|
||||||
|
|
||||||
|
last_updates['indices']['time'] = indices_time
|
||||||
|
last_updates['indices']['force'] = False
|
||||||
|
update_process = Process(target = updateIndices, args = (api_key,logf))
|
||||||
|
update_process.start()
|
||||||
|
update_processes.append(update_process)
|
||||||
|
|
||||||
# weather
|
# weather
|
||||||
weather_time = datetime.strptime(last_updates['weather']['time'], "%d/%m/%Y %H:%M:%S")
|
weather_time = datetime.strptime(last_updates['weather']['time'], "%d/%m/%Y %H:%M:%S")
|
||||||
|
|
||||||
@ -917,18 +1004,19 @@ if __name__ == '__main__':
|
|||||||
time.sleep(10)
|
time.sleep(10)
|
||||||
|
|
||||||
|
|
||||||
except Exception as e:
|
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]
|
||||||
logf.write(str(e))
|
# logf.write(str(e))
|
||||||
logf.write('. file: ' + fname)
|
# logf.write('. file: ' + fname)
|
||||||
logf.write('. line: ' + str(exc_tb.tb_lineno))
|
# logf.write('. line: ' + str(exc_tb.tb_lineno))
|
||||||
logf.write('. type: ' + str(exc_type))
|
# 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.write('\n ' + "".join(traceback.format_exception(sys.exc_info()[0], sys.exc_info()[1], sys.exc_info()[2])))
|
||||||
logf.close()
|
# logf.close()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
BIN
feature_titles/indices.png
Normal file
After Width: | Height: | Size: 425 B |
BIN
feature_titles/small_feature_titles/indices.png
Normal file
After Width: | Height: | Size: 302 B |
BIN
feature_titles/small_feature_titles/sports_future.png
Normal file
After Width: | Height: | Size: 336 B |
BIN
feature_titles/small_feature_titles/sports_past.png
Normal file
After Width: | Height: | Size: 333 B |
BIN
feature_titles/small_feature_titles/sports_team_stats.png
Normal file
After Width: | Height: | Size: 392 B |
BIN
logos/crypto/ACA.png
Normal file
After Width: | Height: | Size: 2.1 KiB |
BIN
logos/crypto/ACH.png
Normal file
After Width: | Height: | Size: 981 B |
BIN
logos/crypto/ADS.png
Normal file
After Width: | Height: | Size: 991 B |
BIN
logos/crypto/ADX.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
logos/crypto/AE.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
logos/crypto/AERGO.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
logos/crypto/AETHC.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
logos/crypto/AION.png
Normal file
After Width: | Height: | Size: 789 B |
BIN
logos/crypto/ALBT.png
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
logos/crypto/ALEPH.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
logos/crypto/ALI.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
logos/crypto/ALPACA.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
logos/crypto/ALPINE.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
logos/crypto/ALUSD.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
logos/crypto/AMA.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
logos/crypto/APE.png
Normal file
After Width: | Height: | Size: 2.7 KiB |
BIN
logos/crypto/APX.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
logos/crypto/ASK.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
logos/crypto/ASTR.png
Normal file
After Width: | Height: | Size: 2.8 KiB |
BIN
logos/crypto/ATM.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
logos/crypto/AUCTION.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
logos/crypto/AUTO.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
logos/crypto/AVA.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
logos/crypto/AVINOC.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
logos/crypto/AXEL.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
logos/crypto/AXN.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
logos/crypto/BCN.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
logos/crypto/BCT.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
logos/crypto/BEAM.png
Normal file
After Width: | Height: | Size: 2.1 KiB |
BIN
logos/crypto/BEL.png
Normal file
After Width: | Height: | Size: 985 B |
BIN
logos/crypto/BICO.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
logos/crypto/BIGSB.png
Normal file
After Width: | Height: | Size: 766 B |
BIN
logos/crypto/BIT.png
Normal file
After Width: | Height: | Size: 914 B |
BIN
logos/crypto/BITCI.png
Normal file
After Width: | Height: | Size: 828 B |
BIN
logos/crypto/BLZ.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
logos/crypto/BMX.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
logos/crypto/BOA.png
Normal file
After Width: | Height: | Size: 934 B |
BIN
logos/crypto/BONE.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
logos/crypto/BOR.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
logos/crypto/BSW.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
logos/crypto/BTM.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
logos/crypto/BTR.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
logos/crypto/CCD.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
logos/crypto/CEEK.png
Normal file
After Width: | Height: | Size: 2.7 KiB |
BIN
logos/crypto/CERE.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
logos/crypto/CET.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.6 KiB |
BIN
logos/crypto/CGS.png
Normal file
After Width: | Height: | Size: 1.9 KiB |
BIN
logos/crypto/CITY.png
Normal file
After Width: | Height: | Size: 2.4 KiB |
BIN
logos/crypto/CLV.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
logos/crypto/COS.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
logos/crypto/CQT.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
logos/crypto/CTC.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
logos/crypto/CUBE.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
logos/crypto/CUDOS.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
logos/crypto/CULT.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
logos/crypto/CUSD.png
Normal file
After Width: | Height: | Size: 1.0 KiB |
BIN
logos/crypto/CWEB.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
logos/crypto/CXO.png
Normal file
After Width: | Height: | Size: 1.9 KiB |
BIN
logos/crypto/DEXE.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
logos/crypto/DEXT.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
logos/crypto/DF.png
Normal file
After Width: | Height: | Size: 966 B |
BIN
logos/crypto/DFI.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
logos/crypto/DIA.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
logos/crypto/DKA.png
Normal file
After Width: | Height: | Size: 838 B |
BIN
logos/crypto/DOCK.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
logos/crypto/DOLA.png
Normal file
After Width: | Height: | Size: 1.9 KiB |
BIN
logos/crypto/DOME.png
Normal file
After Width: | Height: | Size: 2.1 KiB |
BIN
logos/crypto/DPI.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
logos/crypto/DXD.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
logos/crypto/EFI.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
logos/crypto/ELA.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
logos/crypto/EMAID.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
logos/crypto/EURS.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
logos/crypto/EURT.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
logos/crypto/EVER.png
Normal file
After Width: | Height: | Size: 223 B |
BIN
logos/crypto/FARM.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
logos/crypto/FCT.png
Normal file
After Width: | Height: | Size: 1.0 KiB |
BIN
logos/crypto/FEI.png
Normal file
After Width: | Height: | Size: 1.0 KiB |
BIN
logos/crypto/FER.png
Normal file
After Width: | Height: | Size: 2.5 KiB |
BIN
logos/crypto/FINE.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
logos/crypto/FIO.png
Normal file
After Width: | Height: | Size: 635 B |
BIN
logos/crypto/FIRO.png
Normal file
After Width: | Height: | Size: 864 B |
BIN
logos/crypto/FIS.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
logos/crypto/FITFI.png
Normal file
After Width: | Height: | Size: 914 B |
BIN
logos/crypto/FLM.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
logos/crypto/FLOKI.png
Normal file
After Width: | Height: | Size: 1.9 KiB |
BIN
logos/crypto/FLUX.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
logos/crypto/FLX.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
logos/crypto/FRONT.png
Normal file
After Width: | Height: | Size: 1.6 KiB |