<%@ page language = "java"%><%@ page import = "java.util.*"%><%@ page import = "java.sql.*"%><%@ page import = "java.io.*"%><%@ page import = "java.net.*"%><%@ page import = "ajax.*"%><%@ page contentType="text/xml" %><%!

public String slurp (InputStream in) throws IOException {
    StringBuffer out = new StringBuffer();
    byte[] b = new byte[4096];
    for (int n; (n = in.read(b)) != -1;) {
        out.append(new String(b, 0, n));
    }
    return out.toString();
}




public String get(String urlstring){

HttpURLConnection conn = null;

try{


URL url = new URL (urlstring);
conn = (HttpURLConnection)url.openConnection();	
conn.setRequestProperty("User-agent","Mozilla/4.0");

return (slurp(conn.getInputStream()));


}
catch(Exception e)
{
System.err.println(e);
return "";
}


}



%><%

String urlstring = request.getParameter("url");
urlstring = urlstring.replaceAll(" ","+");
System.out.println(urlstring);
out.println(get(urlstring));


%>