Improve error output and add team id matcher template creator
This commit is contained in:
@@ -121,4 +121,23 @@ public class APIFootballConnector {
|
||||
|
||||
return object;
|
||||
}
|
||||
|
||||
public JSONObject getTeamsForLeague(int league) {
|
||||
String url = "https://v2.api-football.com/teams/league/" + league;
|
||||
String content = new APIFootballUpdater(0).getRawData(url);
|
||||
return stringToJSONObject(content);
|
||||
}
|
||||
|
||||
private JSONObject stringToJSONObject(String rawData) {
|
||||
|
||||
JSONParser parser = new JSONParser();
|
||||
JSONObject data = null;
|
||||
try {
|
||||
data = (JSONObject) parser.parse(rawData);
|
||||
} catch (Exception e) {
|
||||
/* TODO */
|
||||
e.printStackTrace();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user