<%@ page language = "java" import="java.util.*" import = "java.net.*" import = "java.io.*" import = "java.util.regex.*" %>
<% 
	StringBuilder result = new StringBuilder();
	URL url = new URL("http://motd.ambians.com/quotes.php/name/linux_fortunes_random/toc_id/1-1-1");
	HttpURLConnection conn = (HttpURLConnection) url.openConnection();
	conn.setRequestMethod("GET");
	BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
	String line;
	while ((line = rd.readLine()) != null) {
		result.append(line);
	}
	rd.close();
	String html = result.toString();
	Pattern p = Pattern.compile("<pre>([^<]*)</pre>");
	Matcher m = p.matcher(html);

	if (m.find()) {
		out.println(m.group(1));
	}
%>