public static void main(String[] args)
      throws IOException, SAXException, ParserConfigurationException, XPathExpressionException {
    // Create an AlchemyAPI object.
    AlchemyAPI alchemyObj = AlchemyAPI.GetInstanceFromFile("api_key.txt");

    // Extract page text from a web URL. (ignoring ads, navigation links,
    // and other content).
    Document doc = alchemyObj.URLGetText("http://www.techcrunch.com/");
    System.out.println(getStringFromDocument(doc));

    // Extract raw page text from a web URL. (including ads, navigation
    // links, and other content).
    doc = alchemyObj.URLGetRawText("http://www.techcrunch.com/");
    System.out.println(getStringFromDocument(doc));

    // Extract a title from a web URL.
    doc = alchemyObj.URLGetTitle("http://www.techcrunch.com/");
    System.out.println(getStringFromDocument(doc));

    // Load a HTML document to analyze.
    String htmlDoc = getFileContents("data/example.html");

    // Extract page text from a HTML document. (ignoring ads, navigation
    // links, and other content).
    doc = alchemyObj.HTMLGetText(htmlDoc, "http://www.test.com/");
    System.out.println(getStringFromDocument(doc));

    // Extract raw page text from a HTML document. (including ads,
    // navigation links, and other content).
    doc = alchemyObj.HTMLGetRawText(htmlDoc, "http://www.test.com/");
    System.out.println(getStringFromDocument(doc));

    // Extract a title from a HTML document.
    doc = alchemyObj.HTMLGetTitle(htmlDoc, "http://www.test.com/");
    System.out.println(getStringFromDocument(doc));
  }