Changeset View
Changeset View
Standalone View
Standalone View
src/it/reyboz/bustorino/backend/FiveTScraperFetcher.java
Show First 20 Lines • Show All 77 Lines • ▼ Show 20 Lines | public Palina ReadArrivalTimesAll(final String stopID, final AtomicReference<Result> res) { | ||||
if(span == null) { | if(span == null) { | ||||
res.set(Result.SERVER_ERROR); | res.set(Result.SERVER_ERROR); | ||||
return p; | return p; | ||||
} | } | ||||
String busStopID = grep("^(.+) ", span.html()); | String busStopID = grep("^(.+) ", span.html()); | ||||
if (busStopID == null) { | if (busStopID == null) { | ||||
//Log.e("BusStop", "Empty busStopID from " + span.html()); | //Log.e("BusStop", "Empty busStopID from " + span.html()); | ||||
res.set(Result.EMPTY_RESULT_SET); | res.set(Result.NOT_FOUND); | ||||
return p; | return p; | ||||
} | } | ||||
// this also appears when no stops are found, but that case has already been handled above | // this also appears when no stops are found, but that case has already been handled above | ||||
Element error = doc.select("p.errore").first(); | Element error = doc.select("p.errore").first(); | ||||
if (error != null) { | if (error != null) { | ||||
res.set(Result.SERVER_ERROR); | res.set(Result.SERVER_ERROR); | ||||
return p; | return p; | ||||
▲ Show 20 Lines • Show All 117 Lines • Show Last 20 Lines |
Public contents are in Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) or GNU Free Documentation License (at your option) unless otherwise noted. · Contact / Register