mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-07 21:48:50 +00:00
stricter patterns
git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@509 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
parent
0927031081
commit
dafd2d1a45
2 changed files with 17 additions and 5 deletions
|
@ -440,7 +440,7 @@ public final class BvgProvider extends AbstractHafasProvider
|
|||
|
||||
private static final Pattern P_CONNECTION_DETAILS_HEAD = Pattern.compile(".*(?:Datum|Abfahrt): (\\d\\d\\.\\d\\d\\.\\d\\d).*", Pattern.DOTALL);
|
||||
private static final Pattern P_CONNECTION_DETAILS_COARSE = Pattern.compile("<p class=\"con\\w\">\n(.+?)</p>", Pattern.DOTALL);
|
||||
static final Pattern P_CONNECTION_DETAILS_FINE = Pattern.compile("(?:<a href=\".*?input=(\\d+).*?\">(?:\n<strong>)?" // departureId
|
||||
static final Pattern P_CONNECTION_DETAILS_FINE = Pattern.compile("(?:<a href=\"/Fahrinfo[^\"]*input=(\\d+)\">(?:\n<strong>)?" // departureId
|
||||
+ "(.+?)(?:</strong>\n)?</a>)?.*?" // departure
|
||||
+ "(?:" //
|
||||
+ "ab (\\d+:\\d+)\n" // departureTime
|
||||
|
@ -449,14 +449,14 @@ public final class BvgProvider extends AbstractHafasProvider
|
|||
+ "Ri\\. (.*?)[\n\\.]*<.*?" // destination
|
||||
+ "an (\\d+:\\d+)\n" // arrivalTime
|
||||
+ "(Gl\\. \\d+)?.*?" // arrivalPosition
|
||||
+ "<a href=\".*?input=(\\d+).*?\">\n" // arrivalId
|
||||
+ "<strong>(.*?)</strong>" // arrival
|
||||
+ "<a href=\"/Fahrinfo[^\"]*input=(\\d+)\">\n" // arrivalId
|
||||
+ "<strong>([^<]*)</strong>" // arrival
|
||||
+ "|" //
|
||||
+ "(\\d+) Min\\.\n" // footway
|
||||
+ "(?:Fussweg|Übergang)\n" //
|
||||
+ "<br />\n" //
|
||||
+ "(?:<a href=\"/Fahrinfo.*?input=(\\d+)\">\n" // arrivalId
|
||||
+ "<strong>(.*?)</strong>|<a href=\"/Stadtplan.*?WGS84,(\\d+),(\\d+)&.*?\">([^<]*)</a>|<strong>([^<]*)</strong>).*?" // arrival
|
||||
+ "(?:<a href=\"/Fahrinfo[^\"]*input=(\\d+)\">\n" // arrivalId
|
||||
+ "<strong>([^<]*)</strong>|<a href=\"/Stadtplan.*?WGS84,(\\d+),(\\d+)&.*?\">([^<]*)</a>|<strong>([^<]*)</strong>).*?" // arrival
|
||||
+ ").*?", Pattern.DOTALL);
|
||||
|
||||
@Override
|
||||
|
|
|
@ -81,4 +81,16 @@ public class BvgProviderLiveTest
|
|||
provider.getConnectionDetails(connection.link);
|
||||
System.out.println(moreResult);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void connectionBetweenCoordinates() throws Exception
|
||||
{
|
||||
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.ADDRESS, 0, 52501507, 13357026), null,
|
||||
new Location(LocationType.ADDRESS, 0, 52513639, 13568648), new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL);
|
||||
System.out.println(result);
|
||||
final QueryConnectionsResult moreResult = provider.queryMoreConnections(result.context);
|
||||
for (final Connection connection : result.connections)
|
||||
provider.getConnectionDetails(connection.link);
|
||||
System.out.println(moreResult);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue