We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No description provided.
The text was updated successfully, but these errors were encountered:
public String getData(String token, String id) throws Exception { URL url = new URL("https://api.spotify.com/v1/playlists/" + id); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setDoOutput(true); connection.setRequestProperty("Accept-Charset", "UTF-8"); connection.setRequestProperty("Authorization", "Bearer " + token); InputStream response = connection.getInputStream(); String result = new BufferedReader(new InputStreamReader(response)) .lines().collect(Collectors.joining("\n")); return result; } public String getInfo(String info, String data) { JSONObject obj = new JSONObject(data); return obj.getString(info); }
Sorry, something went wrong.
name = getInfo("name", data); image = obj.getJSONArray("images").getJSONObject(0).getString("url"); description = getInfo("description", data); followers = Integer.toString(obj.getJSONObject("followers").getInt("total")); owner = obj.getJSONObject("owner").getString("display_name"); songCount = Integer.toString(obj.getJSONObject("tracks").getInt("total")); explicitPercentage = Double.toString(getExplicitPercent(obj)) + "%";
raad1masum
No branches or pull requests
No description provided.
The text was updated successfully, but these errors were encountered: