FetchedDatum result = fetcher.get(new ScoredUrlDatum(url));
System.out.println(String.format("Fetched %s: headers = %s", result.getUrl(), result.getHeaders()));
System.out.flush();
// System.out.println("Result = " + result.toString());
ParsedDatum parsed = parser.parse(result);
System.out.println(String.format("Parsed %s: lang = %s, size = %d", parsed.getUrl(),
parsed.getLanguage(), parsed.getParsedText().length()));
ParsedDatum bpParsed = bpParser.parse(result);
ParsedDatum rawParsed = rawParser.parse(result);
if (interactive) {
while (true) {
System.out.print("Next action - (d)ump regular, dump (b)oilerpipe, dump (r)aw, (e)xit: ");
String action = readInputLine();
if (action.startsWith("e") || (action.length() == 0)) {
break;
} else if (action.startsWith("d")) {
System.out.println("=====================================================================");
System.out.println(parsed.getParsedText());
System.out.println("=====================================================================");
} else if (action.startsWith("b")) {
System.out.println("=====================================================================");
System.out.println(bpParsed.getParsedText());
System.out.println("=====================================================================");
} else if (action.startsWith("r")) {
System.out.println("=====================================================================");
System.out.println(rawParsed.getParsedText());
System.out.println("=====================================================================");
} else {
System.out.println("Unknown command - " + action);
}
}