basic functionallity almost achieved
parent
3ac6eb01cf
commit
f8d85a16ff
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
@ -1,10 +1,24 @@
|
|||||||
package com.calebfontenot.parsers;
|
package com.calebfontenot.parsers;
|
||||||
|
|
||||||
import com.calebfontenot.Common;
|
import com.calebfontenot.Common;
|
||||||
|
import org.json.JSONArray;
|
||||||
|
import org.json.JSONObject;
|
||||||
|
import org.json.JSONTokener;
|
||||||
|
|
||||||
public class Velocity {
|
public class Velocity {
|
||||||
public static final String MODRINTH_API_URL = "https://api.modrinth.com/v2";
|
public static final String MODRINTH_API_URL = "https://api.modrinth.com/v2";
|
||||||
public static void fetchVersions(String modID) throws Exception { // Fetch information about mod versions from the API.
|
public static void fetchVersions(String modID) throws Exception { // Fetch information about mod versions from the API.
|
||||||
System.out.println(Common.parse(MODRINTH_API_URL + "/project/" + modID + "/version", "id"));
|
String versions = Common.regexFetch(MODRINTH_API_URL + "/project/" + modID + "/version");
|
||||||
|
|
||||||
|
//while (true) {
|
||||||
|
JSONTokener tokener = new JSONTokener(versions);
|
||||||
|
JSONObject object = new JSONObject(tokener);
|
||||||
|
//System.out.println(object);
|
||||||
|
String files = Common.regex(object.getJSONArray("files").toString());
|
||||||
|
JSONTokener tokener2 = new JSONTokener(files);
|
||||||
|
JSONObject object2 = new JSONObject(tokener2);
|
||||||
|
System.out.println(object2.getString("url"));
|
||||||
|
|
||||||
|
//}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue