1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
| public static ArrayList<Match> recup() throws Exception {
boolean b = false ;
ArrayList<Match> lst = new ArrayList<Match>();
URL oracle = new URL("http://csgolounge.com/");//Scan
URLConnection yc = oracle.openConnection();
BufferedReader in = new BufferedReader(new InputStreamReader(yc.getInputStream()));
String inputLine;//Ligne de code
while ((inputLine = in.readLine()) != null)
if(inputLine.contains("matchmain") || b){
Match m = new Match();
while(!(inputLine = in.readLine()).contains("whenm")){
}
m.time = cut(inputLine, 19);
while(!(inputLine = in.readLine()).contains("eventm")){
}
m.comp = cut(inputLine, 20);
while(!(inputLine = in.readLine()).contains("teamtext")){
}
m.t1 = cut(inputLine, 31);
in.readLine();
while(!(inputLine = in.readLine()).contains("teamtext")){
}
m.t2 = cut(inputLine, 31);
lst.add(m);
}
in.close();
return lst;
} |