Skip to content

Instantly share code, notes, and snippets.

@Lanse505
Created May 16, 2020 08:57
Show Gist options
  • Save Lanse505/5559ea3c26f6cefed629dc6b2bb2dcf0 to your computer and use it in GitHub Desktop.
Save Lanse505/5559ea3c26f6cefed629dc6b2bb2dcf0 to your computer and use it in GitHub Desktop.
public static void nhlTeamName(int lagId) throws ParseException {
nhlData = jsonGetRequest("https://statsapi.web.nhl.com/api/v1/teams/"+lagId);
jsonObj = (JSONObject) jsonPar.parse(nhlData);
teams = (JSONArray) jsonObj.get("teams");
for(int i = 0; i < teams.size(); i++){
team = (JSONObject) teams.get(i);
teamName = team.get("name").toString();
System.out.println(teamName);
System.out.println("");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment