35 lines
1.3 KiB
Java
35 lines
1.3 KiB
Java
package org.example;
|
|
|
|
import org.jsoup.Jsoup;
|
|
import org.jsoup.Connection;
|
|
|
|
public class ChampionshipJorneysTest {
|
|
public static void main(String[] args) {
|
|
String[] urls = {
|
|
"https://api.afavcd.pt/championship/1/jorneys",
|
|
"https://api.afavcd.pt/championship/1/jorneys/1",
|
|
"https://api.afavcd.pt/championship/3/jorneys",
|
|
"https://api.afavcd.pt/championship/1/standings"
|
|
};
|
|
|
|
for (String url : urls) {
|
|
System.out.println("Testing: " + url);
|
|
try {
|
|
Connection.Response response = Jsoup.connect(url)
|
|
.ignoreContentType(true)
|
|
.userAgent("Mozilla/5.0 (Windows NT 10.0; Win64; x64)")
|
|
.header("Referer", "https://www.afavcd.pt/")
|
|
.header("Origin", "https://www.afavcd.pt")
|
|
.method(Connection.Method.GET)
|
|
.execute();
|
|
System.out.println("Status: " + response.statusCode() + " Length: " + response.body().length());
|
|
if (response.statusCode() == 200) {
|
|
System.out.println("Result: " + response.body());
|
|
}
|
|
} catch (Exception e) {
|
|
// System.out.println("Failed: " + e.getMessage());
|
|
}
|
|
}
|
|
}
|
|
}
|