]> git.mxchange.org Git - friendica.git/blobdiff - mod/parse_url.php
Merge pull request #2251 from annando/1601-plaintext
[friendica.git] / mod / parse_url.php
index 50c6a15b0e7c7837326edd43b468334efe922d00..28869b4c128d7ecd3d1f5b8436297b8b11aad5c5 100644 (file)
@@ -1,16 +1,20 @@
 <?php
-/* To-Do
-https://developers.google.com/+/plugins/snippet/
-
-<meta itemprop="name" content="Toller Titel">
-<meta itemprop="description" content="Eine tolle Beschreibung">
-<meta itemprop="image" content="http://maple.libertreeproject.org/images/tree-icon.png">
-
-<body itemscope itemtype="http://schema.org/Product">
-  <h1 itemprop="name">Shiny Trinket</h1>
-  <img itemprop="image" src="{image-url}" />
-  <p itemprop="description">Shiny trinkets are shiny.</p>
-</body>
+/** 
+ * @file mod/parse_url.php
+ * 
+ * @todo https://developers.google.com/+/plugins/snippet/
+ * 
+ * @verbatim
+ * <meta itemprop="name" content="Toller Titel">
+ * <meta itemprop="description" content="Eine tolle Beschreibung">
+ * <meta itemprop="image" content="http://maple.libertreeproject.org/images/tree-icon.png">
+ * 
+ * <body itemscope itemtype="http://schema.org/Product">
+ *   <h1 itemprop="name">Shiny Trinket</h1>
+ *   <img itemprop="image" src="{image-url}" />
+ *   <p itemprop="description">Shiny trinkets are shiny.</p>
+ * </body>
+ * @endverbatim
 */
 
 if(!function_exists('deletenode')) {
@@ -60,7 +64,7 @@ function parseurl_getsiteinfo_cached($url, $no_guessing = false, $do_oembed = tr
 
        $data = parseurl_getsiteinfo($url, $no_guessing, $do_oembed);
 
-       Cache::set("parse_url:".$no_guessing.":".$do_oembed.":".$url,serialize($data));
+       Cache::set("parse_url:".$no_guessing.":".$do_oembed.":".$url,serialize($data), CACHE_DAY);
 
        return $data;
 }
@@ -280,7 +284,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]");