Created
May 31, 2019 00:25
-
-
Save Thomascountz/3ae313c1d3ccf025ce1af050b2a46b32 to your computer and use it in GitHub Desktop.
Initial Bobby Script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let stopCode = "901308" | |
fetch(`https://bustime.mta.info/api/siri/stop-monitoring.json?key=REDACTED&version=2&MonitoringRef=${stopCode}`) | |
.then(function (response) { | |
return response.json(); | |
}).then(function (json) { | |
console.log(json.Siri.ServiceDelivery.StopMonitoringDelivery[0].MonitoredStopVisit.map(visit => { | |
return visit.MonitoredVehicleJourney.MonitoredCall.ArrivalProximityText | |
})) | |
}); | |
//=> [ "1.2 miles away", "2.3 miles away", "3.1 miles away" ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment