mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-08 18:28:49 +00:00
workaround zebra mechanism is currently broken on service
git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@344 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
parent
114f8db546
commit
0a77d3391f
1 changed files with 9 additions and 7 deletions
|
@ -108,7 +108,8 @@ public class SbbProvider extends AbstractHafasProvider
|
||||||
|
|
||||||
public QueryDeparturesResult queryDepartures(final String stationId, final int maxDepartures) throws IOException
|
public QueryDeparturesResult queryDepartures(final String stationId, final int maxDepartures) throws IOException
|
||||||
{
|
{
|
||||||
final CharSequence page = ParserUtils.scrape(departuresQueryUri(stationId, maxDepartures));
|
final String uri = departuresQueryUri(stationId, maxDepartures);
|
||||||
|
final CharSequence page = ParserUtils.scrape(uri);
|
||||||
|
|
||||||
// parse page
|
// parse page
|
||||||
final Matcher mHeadCoarse = P_DEPARTURES_HEAD_COARSE.matcher(page);
|
final Matcher mHeadCoarse = P_DEPARTURES_HEAD_COARSE.matcher(page);
|
||||||
|
@ -131,16 +132,17 @@ public class SbbProvider extends AbstractHafasProvider
|
||||||
.parseTime(mHeadFine.group(2)));
|
.parseTime(mHeadFine.group(2)));
|
||||||
final int locationId = Integer.parseInt(mHeadFine.group(4));
|
final int locationId = Integer.parseInt(mHeadFine.group(4));
|
||||||
final List<Departure> departures = new ArrayList<Departure>(8);
|
final List<Departure> departures = new ArrayList<Departure>(8);
|
||||||
String oldZebra = null;
|
// String oldZebra = null;
|
||||||
|
|
||||||
final Matcher mDepCoarse = P_DEPARTURES_COARSE.matcher(mHeadCoarse.group(2));
|
final Matcher mDepCoarse = P_DEPARTURES_COARSE.matcher(mHeadCoarse.group(2));
|
||||||
while (mDepCoarse.find())
|
while (mDepCoarse.find())
|
||||||
{
|
{
|
||||||
final String zebra = mDepCoarse.group(1);
|
// zebra mechanism is currently broken on service
|
||||||
if (oldZebra != null && zebra.equals(oldZebra))
|
// final String zebra = mDepCoarse.group(1);
|
||||||
throw new IllegalArgumentException("missed row? last:" + zebra);
|
// if (oldZebra != null && zebra.equals(oldZebra))
|
||||||
else
|
// throw new IllegalArgumentException("missed row? last:" + zebra);
|
||||||
oldZebra = zebra;
|
// else
|
||||||
|
// oldZebra = zebra;
|
||||||
|
|
||||||
final Matcher mDepFine = P_DEPARTURES_FINE.matcher(mDepCoarse.group(2));
|
final Matcher mDepFine = P_DEPARTURES_FINE.matcher(mDepCoarse.group(2));
|
||||||
if (mDepFine.matches())
|
if (mDepFine.matches())
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue