CHPP Development/Java/Login examples
From Hattrick
Step1: Getting the recommended server
public boolean getRecommendedServer() {
try {
URL url = new URL("http://www.hattrick.org/Common/menu.asp?outputType=XML");
URLConnection connection = url.openConnection();
BufferedReader br = new BufferedReader(
new InputStreamReader(connection.getInputStream()));
String line = "";
while ((line = br.readLine()) != null) {
//do something with the line
//maybe write it into a file
}
} catch (Exception e) {
e.printStackTrace();
return false;
}
return true;
}