X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=mod%2Fparse_url.php;h=ef051d9f6b433c0e8152c39168c0debd8cfbee0a;hb=6fa729b0bb274e41dbd065327009659222ae78dd;hp=71d767675f8c51a1b3cba44b3edae4e2bd0c7bf8;hpb=98bba66dcb335a86385967bc08ce30f5be0f4b75;p=friendica.git diff --git a/mod/parse_url.php b/mod/parse_url.php index 71d767675f..ef051d9f6b 100644 --- a/mod/parse_url.php +++ b/mod/parse_url.php @@ -50,6 +50,21 @@ function completeurl($url, $scheme) { return($complete); } +function parseurl_getsiteinfo_cached($url, $no_guessing = false, $do_oembed = true) { + + $data = Cache::get("parse_url:".$no_guessing.":".$do_oembed.":".$url); + if (!is_null($data)) { + $data = unserialize($data); + return $data; + } + + $data = parseurl_getsiteinfo($url, $no_guessing, $do_oembed); + + Cache::set("parse_url:".$no_guessing.":".$do_oembed.":".$url,serialize($data), CACHE_DAY); + + return $data; +} + function parseurl_getsiteinfo($url, $no_guessing = false, $do_oembed = true, $count = 1) { require_once("include/network.php"); @@ -265,7 +280,8 @@ function parseurl_getsiteinfo($url, $no_guessing = false, $do_oembed = true, $co if (isset($keywords)) { $siteinfo["keywords"] = array(); foreach ($keywords as $keyword) - $siteinfo["keywords"][] = trim($keyword); + if (!in_array(trim($keyword), $siteinfo["keywords"])) + $siteinfo["keywords"][] = trim($keyword); } //$list = $xpath->query("head/meta[@property]");