A Java interface to cricbuzz, with options to get live scores and live commentary.
You can find detailed explaination here: javacricbuzz blog
Requirements
jsoup library: https://jsoup.org/download
One can also directly download the jar file which conatins all the dependencies packed: Cricbuzz.jar
Features
- Get upcoming, live and recently concluded matches
- Summary of each of the matches
- Commentary for live matches
Basic Usage
import cricbuzz.Cricbuzz; #Assuming that source file is in a package named cricbuzz
Cricbuzz c = new Cricbuzz();
Get all the matches(live,upcoming and recently finished matches)
Vector<HashMap<String,String>> matches = c.matches();
Gson gson = new GsonBuilder().setPrettyPrinting().create(); #Add gson library in case you want a pretty output
String json = gson.toJson(matches);
System.out.println(json);
Each match will have an attribute 'id'. Use this 'id' to get scorecard, brief score and commentary of matches.
Get brief score of a match
String id = matches.get(0).get("id");
Map<String,Map> score = c.livescore(id);
json = gson.toJson(score);
System.out.println(json);
Get commentary of a match
Map<String,Map> comm = c.commentary(id);
json = gson.toJson(comm);
System.out.println(json);