mucho progress on notifier, email style dfrn url's
This commit is contained in:
parent
e98aaa3cbd
commit
9a6a60a9c1
9 changed files with 181 additions and 34 deletions
|
|
@ -76,5 +76,29 @@ function validate_dfrn($a) {
|
|||
return $errors;
|
||||
}}
|
||||
|
||||
if(! function_exists('scrape_meta')) {
|
||||
function scrape_meta($url) {
|
||||
|
||||
$ret = array();
|
||||
$s = fetch_url($url);
|
||||
|
||||
if(! $s)
|
||||
return $ret;
|
||||
|
||||
$dom = HTML5_Parser::parse($s);
|
||||
|
||||
if(! $dom)
|
||||
return $ret;
|
||||
|
||||
$items = $dom->getElementsByTagName('meta');
|
||||
|
||||
// get DFRN link elements
|
||||
|
||||
foreach($items as $item) {
|
||||
$x = $item->getAttribute('name');
|
||||
if(substr($x,0,5) == "dfrn-")
|
||||
$ret[$x] = $item->getAttribute('content');
|
||||
}
|
||||
|
||||
return $ret;
|
||||
}}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue