Changeset View
Changeset View
Standalone View
Standalone View
src/it/reyboz/bustorino/backend/GTTStopsFetcher.java
Show First 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | public List<Stop> FindByName(String name, AtomicReference<Result> res) { | ||||
String content; | String content; | ||||
String bacino; | String bacino; | ||||
String localita; | String localita; | ||||
Route.Type type; | Route.Type type; | ||||
JSONArray json; | JSONArray json; | ||||
int howManyStops, i; | int howManyStops, i; | ||||
JSONObject thisstop; | JSONObject thisstop; | ||||
if(name.length() < 3) { | if(name.length() < 2) { | ||||
res.set(Result.QUERY_TOO_SHORT); | res.set(Result.QUERY_TOO_SHORT); | ||||
return s; | return s; | ||||
} | } | ||||
try { | try { | ||||
url = new URL("https://www.gtt.to.it/cms/index.php?option=com_gtt&view=palinejson&term=" + URLEncoder.encode(name, "utf-8")); | url = new URL("https://www.gtt.to.it/cms/index.php?option=com_gtt&view=palinejson&term=" + URLEncoder.encode(name, "utf-8")); | ||||
} catch (Exception e) { | } catch (Exception e) { | ||||
res.set(Result.PARSER_ERROR); | res.set(Result.PARSER_ERROR); | ||||
▲ Show 20 Lines • Show All 133 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