Main.java 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. import java.io.BufferedReader;
  2. import java.io.IOException;
  3. import java.io.InputStreamReader;
  4. import main.ArbChecker;
  5. import parser.OddsPortal;
  6. public class Main {
  7. public static void main(String[] args) {
  8. // testExpektParser();
  9. updateFromOddsportal();
  10. // testArbMatches();
  11. // op.getHistoricMatches("soccer", "japan", "j2-league", "2020");
  12. // callingRScript();
  13. }
  14. private static void callingRScript() throws IOException {
  15. System.out.println(System.getProperty("user.dir"));
  16. final String rPath = System.getProperty("user.dir") + "\\src\\RScript\\scorePrediction.R";
  17. final Process exec = Runtime.getRuntime().exec("C:\\Program Files\\R\\R-3.6.3\\bin\\Rscript.exe " + rPath);
  18. final BufferedReader stdInput = new BufferedReader(new InputStreamReader(exec.getInputStream()));
  19. final BufferedReader stdError = new BufferedReader(new InputStreamReader(exec.getErrorStream()));
  20. // Read the output from the command
  21. System.out.println("Here is the standard output of the command:\n");
  22. String s = null;
  23. while ((s = stdInput.readLine()) != null) {
  24. System.out.println(s);
  25. }
  26. // Read any errors from the attempted command
  27. System.out.println("Here is the standard error of the command (if any):\n");
  28. while ((s = stdError.readLine()) != null) {
  29. System.out.println(s);
  30. }
  31. }
  32. private static void testArbMatches() {
  33. new ArbChecker();
  34. }
  35. private static void updateFromOddsportal() {
  36. final OddsPortal op = new OddsPortal();
  37. System.out.println("Getting Yesterdays matches");
  38. op.getYesterdaysMatches();
  39. System.out.println("Getting Todays Matches");
  40. op.getTodaysMatches();
  41. System.out.println("Getting tomorrows matches");
  42. op.getTomorrowsMatches();
  43. System.out.println("Getting next matches");
  44. op.getNextDaysMatches();
  45. }
  46. }