FileDocCategorySizeDatePackage
lycos.javaAPI DocExample773Thu Apr 03 15:15:20 BST 1997None

lycos.java

import java.net.*;
import java.io.*;


public class lycos {

  public static void main (String[] args) {
  
    String querystring = "";
    
    for (int i = 0; i < args.length; i++) {
      querystring += args[i] + " ";
    }
    querystring.trim();
    querystring = "query=" + URLEncoder.encode(querystring);
    try {
      String thisLine;
      URL u = new URL("http://www.lycos.com/cgi-bin/pursuit?" + querystring);
      DataInputStream theHTML = new DataInputStream(u.openStream());
      while ((thisLine = theHTML.readLine()) != null) {
        System.out.println(thisLine);
      } // while loop ends here
    }
    catch (MalformedURLException e) {
      System.err.println(e);
    }
    catch (IOException e) {
      System.err.println(e);
    }
    
  }

}