-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathTest.java
37 lines (26 loc) · 978 Bytes
/
Test.java
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
33
34
35
36
package test;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import java.util.*;
import cricbuzz.Cricbuzz;
import java.io.IOException;
public class Test {
public static void main(String[] args) throws IOException{
Cricbuzz c = new Cricbuzz();
Vector<HashMap<String,String>> matches = c.matches();
Gson gson = new GsonBuilder().setPrettyPrinting().create();
String json = gson.toJson(matches);
//System.out.println(json);
Integer i = 0;
for(i = 0; i < matches.size(); i++) {
String id = matches.get(i).get("id");
Map<String,Map> score = c.livescore(id);
json = gson.toJson(score);
//System.out.println(json);
Map<String,Map> comm = c.commentary(id);
json = gson.toJson(comm);
System.out.println(json);
break;
}
}
}