Package org.encog.util.http

Examples of org.encog.util.http.FormUtility


  public Collection<URL> search(final String searchFor) throws IOException {
    Collection<URL> result = null;

    // build the URL
    final ByteArrayOutputStream bos = new ByteArrayOutputStream();
    final FormUtility form = new FormUtility(bos, null);
    form.add("appid", "YahooDemo");
    form.add("results", "100");
    form.add("query", searchFor);
    form.complete();

    final URL url = new URL(
        "http://search.yahooapis.com/WebSearchService/V1/webSearch?"
            + bos.toString());
    bos.close();
View Full Code Here


        os = connection.getOutputStream();

      }

      // add the parameters if present
      final FormUtility formData = new FormUtility(os, null);
      for (final DocumentRange dr : form.getElements()) {
        if (dr instanceof FormElement) {
          final FormElement element = (FormElement) dr;
          if ((element == submit) || element.isAutoSend()) {
            final String name = element.getName();
            String value = element.getValue();
            if (name != null) {
              if (value == null) {
                value = "";
              }
              formData.add(name, value);
            }
          }
        }
      }
View Full Code Here

    final Calendar calendarTo = Calendar.getInstance();
    calendarTo.setTime(to);

    // construct the URL
    final OutputStream os = new ByteArrayOutputStream();
    final FormUtility form = new FormUtility(os, null);
    form.add("s", ticker.toUpperCase());
    form.add("a", "" + calendarFrom.get(Calendar.MONTH));
    form.add("b", "" + calendarFrom.get(Calendar.DAY_OF_MONTH));
    form.add("c", "" + calendarFrom.get(Calendar.YEAR));
    form.add("d", "" + calendarTo.get(Calendar.MONTH));
    form.add("e", "" + calendarTo.get(Calendar.DAY_OF_MONTH));
    form.add("f", "" + calendarTo.get(Calendar.YEAR));
    form.add("g", "d");
    form.add("ignore", ".csv");
    os.close();
    final String str = "http://ichart.finance.yahoo.com/table.csv?"
        + os.toString();
    return new URL(str);
  }
View Full Code Here

        os = connection.getOutputStream();

      }

      // add the parameters if present
      final FormUtility formData = new FormUtility(os, null);
      for (final DocumentRange dr : form.getElements()) {
        if (dr instanceof FormElement) {
          final FormElement element = (FormElement) dr;
          if ((element == submit) || element.isAutoSend()) {
            final String name = element.getName();
            String value = element.getValue();
            if (name != null) {
              if (value == null) {
                value = "";
              }
              formData.add(name, value);
            }
          }
        }
      }
View Full Code Here

    final Calendar calendarTo = Calendar.getInstance();
    calendarTo.setTime(to);

    // construct the URL
    final OutputStream os = new ByteArrayOutputStream();
    final FormUtility form = new FormUtility(os, null);
    form.add("s", ticker.toUpperCase());
    form.add("a", "" + calendarFrom.get(Calendar.MONTH));
    form.add("b", "" + calendarFrom.get(Calendar.DAY_OF_MONTH));
    form.add("c", "" + calendarFrom.get(Calendar.YEAR));
    form.add("d", "" + calendarTo.get(Calendar.MONTH));
    form.add("e", "" + calendarTo.get(Calendar.DAY_OF_MONTH));
    form.add("f", "" + calendarTo.get(Calendar.YEAR));
    form.add("g", "d");
    form.add("ignore", ".csv");
    os.close();
    final String str = "http://ichart.finance.yahoo.com/table.csv?"
        + os.toString();
    return new URL(str);
  }
View Full Code Here

    final Calendar calendarTo = Calendar.getInstance();
    calendarTo.setTime(to);

    // construct the URL
    final OutputStream os = new ByteArrayOutputStream();
    final FormUtility form = new FormUtility(os, null);
    form.add("s", ticker.getSymbol().toUpperCase());
    form.add("a", "" + calendarFrom.get(Calendar.MONTH));
    form.add("b", "" + calendarFrom.get(Calendar.DAY_OF_MONTH));
    form.add("c", "" + calendarFrom.get(Calendar.YEAR));
    form.add("d", "" + calendarTo.get(Calendar.MONTH));
    form.add("e", "" + calendarTo.get(Calendar.DAY_OF_MONTH));
    form.add("f", "" + calendarTo.get(Calendar.YEAR));
    form.add("g", "d");
    form.add("ignore", ".csv");
    os.close();
    final String str = "http://ichart.finance.yahoo.com/table.csv?"
        + os.toString();
    return new URL(str);
  }
View Full Code Here

  public Collection<URL> search(final String searchFor) throws IOException {
    Collection<URL> result = null;

    // build the URL
    final ByteArrayOutputStream bos = new ByteArrayOutputStream();
    final FormUtility form = new FormUtility(bos, null);
    form.add("appid", "YahooDemo");
    form.add("results", "100");
    form.add("query", searchFor);
    form.complete();

    final URL url = new URL(
        "http://search.yahooapis.com/WebSearchService/V1/webSearch?"
            + bos.toString());
    bos.close();
View Full Code Here

TOP

Related Classes of org.encog.util.http.FormUtility

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.