-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBusStop.cs
More file actions
29 lines (26 loc) · 762 Bytes
/
BusStop.cs
File metadata and controls
29 lines (26 loc) · 762 Bytes
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
using System;
using System.Collections.Generic;
using RestSharp;
namespace BusBoard
{
public class BusStop
{
private static string _stopId = "";
public static string StopChooser()
{
Console.WriteLine("Please enter the stop ID:\n");
_stopId = Console.ReadLine();
var url = $@"https://api.tfl.gov.uk/StopPoint/{_stopId}/Arrivals?app_id=0f9fc04c&app_key=4931529051075c3fc6489d889a0df590";
return url;
}
public static string StopName(List<Arrivals> arrivals)
{
string busStop = "";
foreach (var arrival in arrivals)
{
busStop = arrival.StationName;
}
return busStop;
}
}
}