SOURCE CODE for lycos program which uses Lycos to search

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

public class lycos {

// conducts a search of the Lycos site using a CGI instruction like:
// http://www.lycos.com/cgi-bin/pusuit?query=java

   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 url = new URL("http://www.lycos.com/cgi-bin/pursuit?" + querystring);
		DataInputStream theHTML = new DataInputStream(url.openStream());
		while ((thisLine = theHTML.readLine()) != null)
		{
			System.out.println (thisLine);
		}
	}
	catch (MalformedURLException e)
	{	System.err.println(e);	}
	catch (IOException e)
	{	System.err.println(e);	}
   }
}