Basic Website Design
This commit is contained in:
@@ -10,7 +10,7 @@ from time import time
|
|||||||
|
|
||||||
class MTA(object):
|
class MTA(object):
|
||||||
def __init__(self, api_key: str, train_lines, station_ids, timing_callbacks=None, alert_callbacks=None,
|
def __init__(self, api_key: str, train_lines, station_ids, timing_callbacks=None, alert_callbacks=None,
|
||||||
endpoints_file="./endpoints.json", callback_frequency=5, max_arrival_time=30):
|
endpoints_file="./endpoints.json", callback_frequency=10, max_arrival_time=30):
|
||||||
self.header = {
|
self.header = {
|
||||||
"x-api-key": api_key
|
"x-api-key": api_key
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,6 +24,9 @@ def get_mta_data():
|
|||||||
subway_data
|
subway_data
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@app.route("/stops", methods=["GET"])
|
||||||
|
def get_routes():
|
||||||
|
return jsonify()
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
api_key = os.getenv('MTA_API_KEY', '')
|
api_key = os.getenv('MTA_API_KEY', '')
|
||||||
@@ -62,7 +65,7 @@ if __name__ == "__main__":
|
|||||||
for t in threads:
|
for t in threads:
|
||||||
t.start()
|
t.start()
|
||||||
|
|
||||||
app.run("0.0.0.0", port=5000)
|
app.run("0.0.0.0", port=5000, debug=True)
|
||||||
# Wait for all threads to complete
|
# Wait for all threads to complete
|
||||||
for t in threads:
|
for t in threads:
|
||||||
t.join()
|
t.join()
|
||||||
|
|||||||
@@ -10,19 +10,32 @@
|
|||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
Yo This will be a kickass display coming soon^tm
|
<div id="main_div">
|
||||||
<br>
|
<div id="header_div">
|
||||||
<span>
|
<span>PI MTA TRACKER</span>
|
||||||
new test
|
</div>
|
||||||
</span>
|
<div class="station_div">
|
||||||
<br>
|
<div class="station_header">
|
||||||
<span>
|
<span>Times Square Station</span>
|
||||||
<button id="test_button">Test Button</button>
|
</div>
|
||||||
</span>
|
<div class="direction_div">
|
||||||
<br>
|
<div class="direction_header"> North</div>
|
||||||
<span id="result">
|
<div>Train 1 Info</div>
|
||||||
|
<div>Train 2 Info</div>
|
||||||
|
<div>Train 3 Info</div>
|
||||||
|
</div>
|
||||||
|
<div class="direction_div">
|
||||||
|
<div class="direction_header"> South</div>
|
||||||
|
<div>Train 1 Info</div>
|
||||||
|
<div>Train 2 Info</div>
|
||||||
|
<div>Train 3 Info</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</span>
|
|
||||||
|
<button id="test_button">Test Button</button>
|
||||||
|
<span id="result"></span>
|
||||||
|
</div>
|
||||||
|
|
||||||
<footer>
|
<footer>
|
||||||
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
|
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
|
||||||
|
|||||||
80
templates/static/css/style.css
Normal file
80
templates/static/css/style.css
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
|
||||||
|
#main_div {
|
||||||
|
margin: 10px;
|
||||||
|
width: 90%;
|
||||||
|
position: absolute;
|
||||||
|
left: 50%;
|
||||||
|
margin-left: -45%;
|
||||||
|
min-width: 500px;
|
||||||
|
background-color: blueviolet;
|
||||||
|
padding: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#test_span {
|
||||||
|
background-color: blue;
|
||||||
|
}
|
||||||
|
|
||||||
|
#header_div {
|
||||||
|
height: 75px;
|
||||||
|
margin: 10px;
|
||||||
|
padding: 10px;
|
||||||
|
display: flex;
|
||||||
|
background-color: coral;
|
||||||
|
}
|
||||||
|
|
||||||
|
.station_div {
|
||||||
|
display: block;
|
||||||
|
overflow: auto;
|
||||||
|
margin: 10px;
|
||||||
|
padding: 10px;
|
||||||
|
|
||||||
|
background-color: lime;
|
||||||
|
}
|
||||||
|
|
||||||
|
.station_header {
|
||||||
|
height: 75px;
|
||||||
|
padding: 10px;
|
||||||
|
|
||||||
|
border-radius: 25px 25px 1px 1px;
|
||||||
|
display: flex;
|
||||||
|
background-color: cornflowerblue;
|
||||||
|
}
|
||||||
|
|
||||||
|
.direction_div {
|
||||||
|
height: 50%;
|
||||||
|
width: 50%;
|
||||||
|
float: left;
|
||||||
|
border-radius: 1px 1px 25px 25px;
|
||||||
|
background-color: aquamarine;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.direction_div div {
|
||||||
|
padding: 10px;
|
||||||
|
/*margin: 10px;*/
|
||||||
|
border-radius: 1px;
|
||||||
|
background-color: chocolate;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*.direction_div div:first-child{*/
|
||||||
|
/* border-radius: 25px 25px 1px 1px;*/
|
||||||
|
/*}*/
|
||||||
|
|
||||||
|
.direction_div div:last-child {
|
||||||
|
border-radius: 1px 1px 25px 25px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.direction_header {
|
||||||
|
background-color: bisque !important;
|
||||||
|
/*border-radius: 1px;*/
|
||||||
|
}
|
||||||
|
|
||||||
|
/*div {*/
|
||||||
|
/* border-radius: 25px;*/
|
||||||
|
/*}*/
|
||||||
|
|
||||||
|
span {
|
||||||
|
display: inline-flex;
|
||||||
|
vertical-align: middle;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
9
test_closures.py
Normal file
9
test_closures.py
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
import requests
|
||||||
|
|
||||||
|
|
||||||
|
headers = {
|
||||||
|
|
||||||
|
}
|
||||||
|
r = requests.get("http://localhost:58381/api/closures?BlockId=B445205")
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user