Commit
·
a53f74c
1
Parent(s):
fbd89a0
api josn 問題
Browse files
app.py
CHANGED
@@ -21,12 +21,12 @@ def prepare_data_chronos(data):
|
|
21 |
def get_tw0050_stocks():
|
22 |
response = requests.get('https://answerbook.david888.com/TW0050')
|
23 |
data = response.json()
|
24 |
-
return [f"{code}.TW" for code in data['
|
25 |
|
26 |
def get_sp500_stocks(limit=50):
|
27 |
response = requests.get('https://answerbook.david888.com/SP500')
|
28 |
data = response.json()
|
29 |
-
return list(data['
|
30 |
|
31 |
def get_nasdaq_stocks(limit=50):
|
32 |
response = requests.get('http://13.125.121.198:8090/stocks/NASDAQ100')
|
@@ -36,7 +36,7 @@ def get_nasdaq_stocks(limit=50):
|
|
36 |
def get_tw0051_stocks():
|
37 |
response = requests.get('https://answerbook.david888.com/TW0051')
|
38 |
data = response.json()
|
39 |
-
return [f"{code}.TW" for code in data['
|
40 |
|
41 |
def get_sox_stocks():
|
42 |
return [
|
|
|
21 |
def get_tw0050_stocks():
|
22 |
response = requests.get('https://answerbook.david888.com/TW0050')
|
23 |
data = response.json()
|
24 |
+
return [f"{code}.TW" for code in data['TW0050'].keys()]
|
25 |
|
26 |
def get_sp500_stocks(limit=50):
|
27 |
response = requests.get('https://answerbook.david888.com/SP500')
|
28 |
data = response.json()
|
29 |
+
return list(data['SP500'].keys())[:limit]
|
30 |
|
31 |
def get_nasdaq_stocks(limit=50):
|
32 |
response = requests.get('http://13.125.121.198:8090/stocks/NASDAQ100')
|
|
|
36 |
def get_tw0051_stocks():
|
37 |
response = requests.get('https://answerbook.david888.com/TW0051')
|
38 |
data = response.json()
|
39 |
+
return [f"{code}.TW" for code in data['TW0051'].keys()]
|
40 |
|
41 |
def get_sox_stocks():
|
42 |
return [
|