mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-07 17:28:49 +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" //
|
+ "<tr class=\"tpDetails sectionInfo\">\n(.*?)</tr>\n" //
|
||||||
, Pattern.DOTALL);
|
, Pattern.DOTALL);
|
||||||
private static final Pattern P_CONNECTION_DETAILS_FINE = Pattern.compile(".*?" //
|
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
|
+ "([^\n<]*).*?" // departure
|
||||||
+ "<td class=\"date\">(?:(\\d{2}\\.\\d{2}\\.\\d{2})| )</td>.*?" // departureDate
|
+ "<td class=\"date\">(?:(\\d{2}\\.\\d{2}\\.\\d{2})| )</td>.*?" // departureDate
|
||||||
+ "<td class=\"timeValue\">\n?<span>ab (\\d{2}:\\d{2}).*?" // departureTime
|
+ "<td class=\"timeValue\">\n?<span>ab (\\d{2}:\\d{2}).*?" // departureTime
|
||||||
+ "<td class=\"platform\">\\s*(?: |(.*?))\\s*</td>.*?" // departurePosition
|
+ "<td class=\"platform\">\\s*(?: |(.*?))\\s*</td>.*?" // departurePosition
|
||||||
+ "<img class=\"product\" src=\"/img/vs_oebb/(\\w+?)_pic.gif\".*?" // lineType
|
+ "<img class=\"product\" src=\"/img/vs_oebb/(\\w+?)_pic.gif\".*?" // lineType
|
||||||
+ "(?:<a href=\"http://fahrplan\\.oebb\\.at/bin/traininfo\\.exe/dn[^>]*>(.*?)</a>.*?)?" // line
|
+ "(?:<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
|
+ "([^\n<]*).*?" // arrival
|
||||||
+ "<td class=\"date\">(?:(\\d{2}\\.\\d{2}\\.\\d{2})| )</td>.*?" // arrivalDate
|
+ "<td class=\"date\">(?:(\\d{2}\\.\\d{2}\\.\\d{2})| )</td>.*?" // arrivalDate
|
||||||
+ "<td class=\"timeValue\">\n?<span>an (\\d{2}:\\d{2}).*?" // arrivalTime
|
+ "<td class=\"timeValue\">\n?<span>an (\\d{2}:\\d{2}).*?" // arrivalTime
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
package de.schildbach.pte.live;
|
package de.schildbach.pte.live;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
|
@ -61,11 +62,27 @@ public class OebbProviderLiveTest
|
||||||
System.out.println(result.stationDepartures);
|
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
|
@Test
|
||||||
public void shortConnection() throws Exception
|
public void shortConnection() throws Exception
|
||||||
{
|
{
|
||||||
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.ANY, 0, null, "Linz"), null, new Location(
|
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.STATION, 1140101, null, "Linz"), null,
|
||||||
LocationType.ANY, 0, null, "Berlin"), new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL);
|
new Location(LocationType.STATION, 1190100, null, "Wien"), new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL);
|
||||||
System.out.println(result);
|
System.out.println(result);
|
||||||
final QueryConnectionsResult moreResult = provider.queryMoreConnections(result.context);
|
final QueryConnectionsResult moreResult = provider.queryMoreConnections(result.context);
|
||||||
System.out.println(moreResult);
|
System.out.println(moreResult);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue