]> git.mxchange.org Git - friendica.git/blobdiff - mod/parse_url.php
community: Only show top postings, no comments
[friendica.git] / mod / parse_url.php
index a2b4c9e28a179c44b997a31602f6c0e2587e638f..1393a15d36b95bd94a9ab69ebd6fa6a38cddacb7 100644 (file)
@@ -97,6 +97,28 @@ function parseurl_getsiteinfo($url) {
 
        $xpath = new DomXPath($doc);
 
+       $list = $xpath->query("//meta[@content]");
+        foreach ($list as $node) {
+                $attr = array();
+                if ($node->attributes->length)
+                        foreach ($node->attributes as $attribute)
+                                $attr[$attribute->name] = $attribute->value;
+
+                if (@$attr["http-equiv"] == 'refresh') {
+                        $path = $attr["content"];
+                        $pathinfo = explode(";", $path);
+                        $content = "";
+                        foreach ($pathinfo AS $value) {
+                                if (substr(strtolower($value), 0, 4) == "url=")
+                                        $content = substr($value, 4);
+                        }
+                        if ($content != "") {
+                                $siteinfo = parseurl_getsiteinfo($content);
+                                return($siteinfo);
+                        }
+                }
+       }
+
        //$list = $xpath->query("head/title");
        $list = $xpath->query("//title");
        foreach ($list as $node)