| 62 | } |
| 63 | |
| 64 | private static JSONObject getJSON(String prefix, Integer suffix) { // Move to ExitParser later |
| 65 | try |
| 66 | { |
| 67 | URL url = new URL(prefix.concat(suffix.toString())); |
| 68 | HttpURLConnection connection = (HttpURLConnection) url.openConnection(); |
| 69 | BufferedReader stream = new BufferedReader(new InputStreamReader(connection.getInputStream())); |
| 70 | StringBuilder result = new StringBuilder(); |
| 71 | String line; |
| 72 | while ((line = stream.readLine()) != null) { |
| 73 | result.append(line); |
| 74 | } |
| 75 | stream.close(); |
| 76 | return new JSONObject(result.toString()); |
| 77 | } |
| 78 | catch (MalformedURLException e) {} |
| 79 | catch (IOException e) {} |
| 80 | return null; |
| 81 | } |
| 82 | |
| 83 | private static JSONObject getJSON(String prefix, String suffix, String _accessToken) { // Move to ExitParser later |
| 84 | try { |