Ejemplo n.º 1
0
  private String getPrizeMoney(int index, int matches) {
    try {
      String temp =
          ReadFromWeb.readWithReferer(
              refererURL
                  + "/?DrawDate="
                  + drawMonth.get(index)
                  + "%20"
                  + drawDay.get(index)
                  + ",%20"
                  + drawYear.get(index)
                  + "&DrawNumber="
                  + (firstdraw + index),
              refererURL);

      int position = temp.indexOf("Straight");
      if (position == -1) throw new Exception();
      String[] a = new String[5];
      for (int i = 0; i < 4; i++) {
        position = temp.indexOf("$", position);
        a[i] = temp.substring(position, temp.indexOf("<", position));
        position++;
      }
      a[4] = "$0";

      if ((style == 0 && matches == 2) || style == 2) return a[style + 2 - matches];
      if (style == 1 && matches > 0) return a[1];
      return a[4];
    } catch (Exception e) {
      return "Reading web failed.";
    }
  }
Ejemplo n.º 2
0
 public Daily4() throws Exception {
   super();
   String data = ReadFromWeb.read(dataURL);
   // System.out.println(data);
   parseText(data);
 }