mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-07 06:08:52 +00:00
adapted to API changes of Austria
git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@664 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
parent
c9fac86b2a
commit
db70b96487
2 changed files with 21 additions and 4 deletions
|
@ -403,14 +403,14 @@ public class OebbProvider extends AbstractHafasProvider
|
|||
+ "<tr class=\"tpDetails sectionInfo\">\n(.*?)</tr>\n" //
|
||||
, Pattern.DOTALL);
|
||||
private static final Pattern P_CONNECTION_DETAILS_FINE = Pattern.compile(".*?" //
|
||||
+ "<td class=\"station\">(?:<a href=\"http://fahrplan\\.oebb\\.at/bin/stboard\\.exe/dn.*?input=(\\d+)&[^>]*>)?" // departureId
|
||||
+ "<td class=\"station\">\n?(?:<a href=\"http://fahrplan\\.oebb\\.at/bin/stboard\\.exe/dn.*?input=(\\d+)&[^>]*>)?" // departureId
|
||||
+ "([^\n<]*).*?" // departure
|
||||
+ "<td class=\"date\">(?:(\\d{2}\\.\\d{2}\\.\\d{2})| )</td>.*?" // departureDate
|
||||
+ "<td class=\"timeValue\">\n?<span>ab (\\d{2}:\\d{2}).*?" // departureTime
|
||||
+ "<td class=\"platform\">\\s*(?: |(.*?))\\s*</td>.*?" // departurePosition
|
||||
+ "<img class=\"product\" src=\"/img/vs_oebb/(\\w+?)_pic.gif\".*?" // lineType
|
||||
+ "(?:<a href=\"http://fahrplan\\.oebb\\.at/bin/traininfo\\.exe/dn[^>]*>(.*?)</a>.*?)?" // line
|
||||
+ "<td class=\"station\">(?:<a href=\"http://fahrplan\\.oebb\\.at/bin/stboard\\.exe/dn.*?input=(\\d+)&[^>]*>)?" // arrivalId
|
||||
+ "<td class=\"station\">\n?(?:<a href=\"http://fahrplan\\.oebb\\.at/bin/stboard\\.exe/dn.*?input=(\\d+)&[^>]*>)?" // arrivalId
|
||||
+ "([^\n<]*).*?" // arrival
|
||||
+ "<td class=\"date\">(?:(\\d{2}\\.\\d{2}\\.\\d{2})| )</td>.*?" // arrivalDate
|
||||
+ "<td class=\"timeValue\">\n?<span>an (\\d{2}:\\d{2}).*?" // arrivalTime
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
package de.schildbach.pte.live;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
|
@ -61,11 +62,27 @@ public class OebbProviderLiveTest
|
|||
System.out.println(result.stationDepartures);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void autoComplete() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("Wien");
|
||||
|
||||
list(autocompletes);
|
||||
}
|
||||
|
||||
private void list(final List<Location> autocompletes)
|
||||
{
|
||||
System.out.print(autocompletes.size() + " ");
|
||||
for (final Location autocomplete : autocompletes)
|
||||
System.out.print(autocomplete.toDebugString() + " ");
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shortConnection() throws Exception
|
||||
{
|
||||
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.ANY, 0, null, "Linz"), null, new Location(
|
||||
LocationType.ANY, 0, null, "Berlin"), new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL);
|
||||
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.STATION, 1140101, null, "Linz"), null,
|
||||
new Location(LocationType.STATION, 1190100, null, "Wien"), new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL);
|
||||
System.out.println(result);
|
||||
final QueryConnectionsResult moreResult = provider.queryMoreConnections(result.context);
|
||||
System.out.println(moreResult);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue