| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- import java.io.BufferedReader;
- import java.io.IOException;
- import java.io.InputStreamReader;
- import parser.ExpektParser;
- import parser.OddsPortal;
- public class Main {
- public static void main(String[] args) {
- //testExpektParser();
- updateFromOddsportal();
- // op.getHistoricMatches("soccer", "japan", "j2-league", "2020");
- // callingRScript();
- }
- private static void testExpektParser() {
- ExpektParser expektParser = new ExpektParser();
- }
- private static void updateFromOddsportal() {
- final OddsPortal op = new OddsPortal();
- System.out.println("Getting Yesterdays matches");
- op.getYesterdaysMatches();
- System.out.println("Getting Todays Matches");
- op.getTodaysMatches();
- System.out.println("Getting tomorrows matches");
- op.getTomorrowsMatches();
- op.getNextDaysMatches();
- }
- private static void callingRScript() throws IOException {
- System.out.println(System.getProperty("user.dir"));
- final String rPath = System.getProperty("user.dir") + "\\src\\RScript\\scorePrediction.R";
- final Process exec = Runtime.getRuntime().exec("C:\\Program Files\\R\\R-3.6.3\\bin\\Rscript.exe " + rPath);
- final BufferedReader stdInput = new BufferedReader(new InputStreamReader(exec.getInputStream()));
- final BufferedReader stdError = new BufferedReader(new InputStreamReader(exec.getErrorStream()));
- // Read the output from the command
- System.out.println("Here is the standard output of the command:\n");
- String s = null;
- while ((s = stdInput.readLine()) != null) {
- System.out.println(s);
- }
- // Read any errors from the attempted command
- System.out.println("Here is the standard error of the command (if any):\n");
- while ((s = stdError.readLine()) != null) {
- System.out.println(s);
- }
- }
- }
|