-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprogram.js
More file actions
31 lines (20 loc) · 1.06 KB
/
program.js
File metadata and controls
31 lines (20 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
const request = require('request');
const ps = require('prompt-sync');
const {getLiveArrivalPredictions, getArrivals} = require('./tflApiClient.js');
const {validatePostcode, getPostCodeCoordinates, fetchBusStops, getBusStops} = require('./postcodeApiClient.js');
const prompt = ps({});
const runProgram = async () => {
// const userStopCode = prompt('Please enter the stop code of your nearest bus stop: ')
// const userPostcode = prompt("Please enter your postcode: ");
//
// getBusStopsInfo(userPostcode);
// getLiveArrivalPredictions(userStopCode);
// validatePostcode('tw94bh')
// getArrivals('490008660N')
// const coordinates = await getPostCodeCoordinates('tw94bh');
// const nearestBusStops = await getBusStops(coordinates);
// const arrivalsClosestBusStop = await getArrivals(nearestBusStops[0].naptanId);
// const arrivalsSecondBusStop = await getArrivals(nearestBusStops[1].naptanId);
console.log(arrivalsClosestBusStop);
}
runProgram()