I am trying make a skin for checking bus departures from a specific bus stop. There is an open API generated page from where I am trying to get the needed information. The trick for me is to filter out the other stops that I am not interested in.
The URL is this:
http://www.labs.skanetrafiken.se/v2.2/stationresults.asp?selPointFrKey=80118
The stop I am interested in is seen in the code like this <StopPoint>G</StopPoint>
And each block for each departing bus looks like this:
Code: Select all
<Line>
<Name>5</Name>
<No>5</No>
<JourneyDateTime>2017-01-27T13:52:00</JourneyDateTime>
<IsTimingPoint>false</IsTimingPoint>
<StopPoint>G</StopPoint>
<LineTypeId>8</LineTypeId>
<LineTypeName>Stadsbuss</LineTypeName>
<Towards>Västra Hamnen via Centralen</Towards>
<RealTime>
<RealTimeInfo>
<DepTimeDeviation>1</DepTimeDeviation>
<DepDeviationAffect>NON_CRITICAL</DepDeviationAffect>
</RealTimeInfo>
</RealTime>
<TrainNo>0</TrainNo>
<Deviations/>
<RunNo>160</RunNo>
</Line>
And it would also be good to be able to grab the name / nr of the bus from <Name>5</Name>
I suppose one would need to use some sort of lookahead or reveresed lookahead maybe?
Thankful for suggestions on how to do this webparsing.
Best,
Bundi