This commit is contained in:
2022-11-29 19:06:58 -06:00
parent 174d6f0156
commit be776d5d57
39 changed files with 1455 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
package com.calebfontenot;
import java.net.*;
import java.io.*;
import org.json.*;
public class Main {
public static void main(String[] args) throws Exception {
System.out.println("CURLing API...");
URL url = new URL("https://api.papermc.io/v2/projects");
try (BufferedReader reader = new BufferedReader(new InputStreamReader(url.openStream(), "UTF-8"))) {
for (String line; (line = reader.readLine()) != null; ) {
JSONObject json = new JSONObject(line);
System.out.println(line);
JSONArray projects = json.getJSONArray("projects");
for (int i = 0; i < projects.length() - 1; i++) {
System.out.println(projects.get(i));
}
}
}
}
}