I am trying to parse messages from a public Facebook fan page wall, but it returns a blank page.
$source = "http://www.facebook.com/?sk=wall&filter=2";
libxml_use_internal_errors(TRUE);
$dom = new DOMDocument();
$dom->loadHTML($source);
$xml = simplexml_import_dom($dom);
libxml_use_internal_errors(FALSE);
$message = $xml->xpath("//span[@class='messageBody']");
return (string)$message[0] . PHP_EOL;
Yet another approach would be to use the JSON from the Graph API