Created
May 13, 2020 12:21
-
-
Save imesut/96320365b2eabbb1577732aa4cf97916 to your computer and use it in GitHub Desktop.
Public Transport Data - Transit Line Info
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 forward_line = resp["lines"][0] | |
let backward_line = resp["lines"][1] | |
let retriever = (line) => { | |
var stops = resp.patterns.filter(x=>x.patternId == line.mostFrequentPatternId) | |
var selectedStops = stops[0].stopIds | |
for(i in selectedStops){ | |
console.log("looking for: " + selectedStops[i]) | |
console.log("result: " + resp.stops.filter(x => x.stopId == selectedStops[i])[0].stopName) | |
} | |
} | |
console.log("Forward lines") | |
retriever(forward_line); | |
console.log("\n") | |
console.log("Backward lines") | |
retriever(backward_line); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment