Changeset View
Changeset View
Standalone View
Standalone View
src/it/reyboz/bustorino/backend/GTTStopsFetcher.java
Show First 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | public List<Stop> FindByName(String name, AtomicReference<Result> res) { | ||||
JSONObject thisstop; | JSONObject thisstop; | ||||
if(name.length() < 3) { | if(name.length() < 3) { | ||||
res.set(Result.QUERY_TOO_SHORT); | res.set(Result.QUERY_TOO_SHORT); | ||||
return s; | return s; | ||||
} | } | ||||
try { | try { | ||||
url = new URL("http://www.gtt.to.it/cms/components/com_gtt/views/palinejson/view.html.php?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); | ||||
return s; | return s; | ||||
} | } | ||||
content = networkTools.queryURL(url, res); | content = networkTools.queryURL(url, res); | ||||
if(content == null) { | if(content == null) { | ||||
return s; | return s; | ||||
▲ Show 20 Lines • Show All 127 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