aboutsummaryrefslogtreecommitdiffstats
path: root/include/Scrape.php
diff options
context:
space:
mode:
authorMike Macgirvin <mike@macgirvin.com>2010-07-08 07:03:25 -0700
committerMike Macgirvin <mike@macgirvin.com>2010-07-08 07:03:25 -0700
commit9a6a60a9c1c7f781790849173e309ac0664d7b35 (patch)
treeb0597e8aeaa20d6ded493b2c053e3e976a53115a /include/Scrape.php
parente98aaa3cbd2c14ab2f1b8534c8c63708086fe0f1 (diff)
downloadvolse-hubzilla-9a6a60a9c1c7f781790849173e309ac0664d7b35.tar.gz
volse-hubzilla-9a6a60a9c1c7f781790849173e309ac0664d7b35.tar.bz2
volse-hubzilla-9a6a60a9c1c7f781790849173e309ac0664d7b35.zip
mucho progress on notifier, email style dfrn url's
Diffstat (limited to 'include/Scrape.php')
-rw-r--r--include/Scrape.php24
1 files changed, 24 insertions, 0 deletions
diff --git a/include/Scrape.php b/include/Scrape.php
index cc5015165..b4a5dd849 100644
--- a/include/Scrape.php
+++ b/include/Scrape.php
@@ -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;
+}}