Put in the URL of the web page that contains microformats. The program will fetch the URL, parse it and then display the results
Example: http://www.mybloglog.com/buzz/members/jbond/
PHP4 (requires DOM-XML and TIDY)
$url = 'http://ciaranmcnulty.com/';
if($html = @file_get_contents($url)){
$html = @tidy_repair_string($html);
if ($dom = @domxml_open_mem($html)) ) {
if ($nodes = $dom->get_elements_by_tagname('a')) {
foreach($nodes as $node){
if ($node->get_attribute('rel')=='me') {
echo $node->get_attribute('href');
}
}
}
}
}
PHP5
$url = 'http://ciaranmcnulty.com/';
if($html = @file_get_contents($url)){
$dom = new DomDocument();
if(@$dom->loadHtml($html)){
if ($nodes = $dom->getElementsByTagName('a')) {
foreach($nodes as $node){
if ($node->getAttribute('rel')=='me') {
echo $node->getAttribute('href');
}
}
}
}
}