Adding in full MTA api.
* Added in support for station search, route specific search, and several time limiting functions Added in functional backend in flask * starts flask app * starts MTA app on another thread * serves basic webpage which pull subway data from flask backend on button press.
This commit is contained in:
31
templates/layouts/index.html
Normal file
31
templates/layouts/index.html
Normal file
@@ -0,0 +1,31 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="/static/css/style.css">
|
||||
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
|
||||
<script src="/static/js/DataRequests.js"></script>
|
||||
<meta charset="UTF-8">
|
||||
<title>SUBWAY DISPLAY!</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
Yo This will be a kickass display coming soon^tm
|
||||
<br>
|
||||
<span>
|
||||
new test
|
||||
</span>
|
||||
<br>
|
||||
<span>
|
||||
<button id="test_button">Test Button</button>
|
||||
</span>
|
||||
<br>
|
||||
<span id="result">
|
||||
|
||||
</span>
|
||||
|
||||
<footer>
|
||||
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
33
templates/static/js/DataRequests.js
Normal file
33
templates/static/js/DataRequests.js
Normal file
@@ -0,0 +1,33 @@
|
||||
$(document).ready(function () {
|
||||
|
||||
function clearCanvas() {
|
||||
var canvas = document.getElementById("inputCanvas");
|
||||
var ctx = canvas.getContext("2d");
|
||||
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
||||
}
|
||||
|
||||
function getData() {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
//the url where you want to sent the userName and password to
|
||||
url: '/mta_data',
|
||||
contentType: "application/json",
|
||||
dataType: "json",
|
||||
async: true,
|
||||
//json object to sent to the authentication url
|
||||
data: JSON.stringify({"test_dict":"test_value"}, null, '\t'),
|
||||
|
||||
success: function (data, text) {
|
||||
$("#result").text(JSON.stringify(data));
|
||||
},
|
||||
error: function (request, status, error) {
|
||||
alert(request.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$("#test_button").click(function () {
|
||||
getData();
|
||||
});
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user