{"id":232,"date":"2012-03-13T11:28:01","date_gmt":"2012-03-13T11:28:01","guid":{"rendered":"https:\/\/pim.famnit.upr.si\/wp\/?p=232"},"modified":"2021-11-17T11:20:36","modified_gmt":"2021-11-17T11:20:36","slug":"php-get-favicon-from-an-url","status":"publish","type":"post","link":"https:\/\/pim.famnit.upr.si\/wp\/?p=232","title":{"rendered":"PHP &#8211; get favicon from an URL"},"content":{"rendered":"<p>I recently commented on <a href=\"http:\/\/www.alandix.com\/blog\/code\/favicon\/\">Alan&#8217;s blog<\/a> about getting <a href=\"http:\/\/en.wikipedia.org\/wiki\/Favicon\">favicon<\/a> from and URL. The <strong>simplest way is getting a domain<\/strong> of an URL <strong>and adding &quot;favicon.ico&quot; at the end.<\/strong> The problem arises if: <\/p>\n<ul>\n<li>the favicon is not on the root on the host name <\/li>\n<li>it has an uncommon name <\/li>\n<li>it is not in MS ICO format which (nowadays PNG is very common).<\/li>\n<\/ul>\n<p>Finding the &lt;link rel=&quot;icon&quot;&gt; or &lt;link rel=&quot;shortcut icon&quot;&gt; in the <strong>DOM of an external URL is hardly possible in Javascript<\/strong> for security reasons (look at the  <strong><a href=\"http:\/\/en.wikipedia.org\/wiki\/XMLHttpRequest\">XMLHttpRequest<\/a><\/strong> for possibilities). One way of doing it is to access external URLs through proxy. <\/p>\n<p>The <strong>simpler<\/strong> way is using some <strong>server side scripting language<\/strong> such us PHP and <strong>a DOM (HTML) parser<\/strong>. I just finished the script and it worked on a few given URLs (with keeping in mind that it could be improved). I deliberately first look at the DOM of a document (see the first bullet above) as for example a personal web page&nbsp; <a href=\"http:\/\/osebje.famnit.upr.si\/%7Emkljun\/\">http:\/\/osebje.famnit.upr.si\/~mkljun\/<\/a> might have a different favicon as the main <a href=\"http:\/\/osebje.famnit.upr.si\/\">http:\/\/osebje.famnit.upr.si\/<\/a> server page. Here&#8217;s the code:<\/p>\n<pre style=\"background-color: #ffffd2;\">&lt;?php\r\nfunction getFavicon ($url) {\r\n&nbsp;&nbsp;&nbsp; $file_headers = @get_headers($url);\r\n&nbsp;&nbsp;&nbsp; $found = FALSE;\r\n    \/\/ 1. CHECK THE DOM FOR THE &lt;link&gt; TAG\r\n&nbsp;&nbsp;&nbsp; \/\/ check if the url exists - if the header returned is not 404\r\n&nbsp;&nbsp;&nbsp; if($file_headers[0] != 'HTTP\/1.1 404 Not Found') {\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $dom = new DOMDocument();\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $dom-&gt;strictErrorChecking = FALSE;\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; @$dom-&gt;loadHTMLfile($url);  \/\/@ to discard all the warnings of malformed htmls\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!$dom) {\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $error[]='Error parsing the DOM of the file';\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } else {\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $domxml = simplexml_import_dom($dom);\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \/\/check for the historical rel=\"shortcut icon\"\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ($domxml-&gt;xpath('\/\/link[@rel=\"shortcut icon\"]')) {\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $path = $domxml-&gt;xpath('\/\/link[@rel=\"shortcut icon\"]');\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $faviconURL = $path[0]['href'];\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $found == TRUE;\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return $faviconURL;\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \/\/check for the HTML5 rel=\"icon\"\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } else if ($domxml-&gt;xpath('\/\/link[@rel=\"icon\"]')) {\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $path = $domxml-&gt;xpath('\/\/link[@rel=\"icon\"]');\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $faviconURL = $path[0]['href'];\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $found == TRUE;\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return $faviconURL;\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } else {\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $error[]=\"The URL does not contain a favicon &lt;link&gt; tag.\";\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }\r\n\r\n        \/\/ 2. CHECK DIRECTLY FOR favicon.ico OR favicon.png FILE\r\n        \/\/ the two seem to be most common\r\n&nbsp;&nbsp;&nbsp;     if ($found == FALSE) {\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;     $parse = parse_url($url);\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;     $favicon_headers = @get_headers(\"http:\/\/\".$parse['host'].\"\/favicon.ico\");\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;     if($favicon_headers[0] != 'HTTP\/1.1 404 Not Found') {\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;     $faviconURL = \"\/favicon.ico\";\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;     $found == TRUE;\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;     return $faviconURL;\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;     }\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;     $favicon_headers = @get_headers(\"http:\/\/\".$parse['host'].\"\/favicon.png\");\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;     if($favicon_headers[0] != 'HTTP\/1.1 404 Not Found') {\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;     $faviconURL = \"\/favicon.png\";\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;     $found == TRUE;\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;     return $faviconURL;\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;     }\r\n            if ($found == FALSE) {\r\n                $error[]= \"Files favicon.ico and .png do not exist on the server's root.\"\r\n            }\r\n        }\r\n    \/\/ if the URL does not exists ...\r\n&nbsp;&nbsp;&nbsp; } else {\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $error[]=\"URL does not exist\";\r\n&nbsp;&nbsp;&nbsp; }\r\n\r\n    if ($found == FALSE &amp;&amp; isset($error) ) {\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return $error;\r\n    }\r\n}\r\n\r\n\/\/ URL in one line \r\n$tempurl = 'http:\/\/stackoverflow.com\/questions\/1732348\/regex-match-open-tags\r\n-except-xhtml-self-contained-tags\/1732454#1732454';\r\n$result = getFavicon ($tempurl);\r\necho $result;\r\n?&gt;<\/pre>\n<p>However, <strong>the script is very slow<\/strong> and parsing badly structured DOMs returns a bucketful of warnings. Hence the @ before $dom-&gt;loadHTMLfile($url). <\/p>\n<p>Although <strong>the slowness<\/strong> of the script can be accounted to <strong>waiting for server to respond<\/strong>, I wondered if <strong>computing times<\/strong> could be <strong>improved<\/strong> (see the measured times below). <\/p>\n<p>Another way of finding the appropriate &lt;link&gt; tag is to <strong>read the file line by line<\/strong> (assuming the link tag is in one line). I know, I know &#8230; but the &lt;link rel=&quot;icon&quot;&gt; is at the beginning of the file and we could exit the loop when we find it. Here&#8217;s the solution echoing the result (note that here is just the changed if sentence from the above function):<\/p>\n<pre style=\"background-color: #ffffd2;\">&nbsp;&nbsp;&nbsp; \/\/check if the url exists\r\n&nbsp;&nbsp;&nbsp; if($file_headers[0] != 'HTTP\/1.1 404 Not Found') {\r\n        \/\/open the pointer to the file \r\n&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $handle = @fopen($url, \"r\");\r\n        \/\/while the file is not end of file\r\n&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; while (!feof($handle)) {\r\n            \/\/read next line\r\n&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $buffer = fgets($handle, 4096);\r\n&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (strstr($buffer, '&lt;link')) {\r\n&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (strstr($buffer, 'icon')) {\r\n&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $doc=new DOMDocument();\r\n&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $doc-&gt;loadHTML('&lt;html&gt;&lt;head&gt;'.$buffer.'&lt;\/head&gt;&lt;body&gt;&lt;\/body&gt;&lt;\/html&gt;');\r\n&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $domxml=simplexml_import_dom($doc); \r\n&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $path=$domxml-&gt;xpath('\/\/link');\r\n&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $faviconURL = $path[0]['href'];\r\n&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $found == TRUE;\r\n&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; echo $faviconURL;\r\n                    \/\/exit the loop\r\n&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; break;\r\n&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }\r\n&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }\r\n&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }\r\n&nbsp;&nbsp;&nbsp; } \r\n<\/pre>\n<p>This version was a bit faster (see user and system times below). I also thought why not giving the <strong>regular expressions<\/strong> a try. I know, I know &#8230; regular expression are not meant to parse HTML. But as we know what we are looking for &#8230;<\/p>\n<pre style=\"background-color: #ffffd2;\">&nbsp;&nbsp;&nbsp; \/\/check if the url exists\r\n&nbsp;&nbsp;&nbsp; if($file_headers[0] != 'HTTP\/1.1 404 Not Found') {\r\n&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $handle = @fopen($url, \"r\");\r\n&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; while (!feof($handle)) {\r\n&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $buffer = fgets($handle, 4096);\r\n&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (strstr($buffer, '&lt;link')) {\r\n&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (strstr($buffer, 'icon')) {\r\n&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; preg_match_all('\/href=[\"\\']([^\"\\']*)[\"\\']\/i',$buffer, $array);\r\n&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;  echo print_r($array);\r\n&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; break;\r\n&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }\r\n&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }\r\n&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }\r\n&nbsp;&nbsp;&nbsp; }\r\n<\/pre>\n<p>The third solution is comparable to the second. However, the response time from the server was quicker?!? Albeit still slow &#8230; maybe I&#8217;m missing something &#8230; but have no time at the moment &#8230; Also, the # of tries I tested each script (around 20) is low to draw any conclusion.<\/p>\n<p>Here are some measured times of running these scripts:<\/p>\n<pre style=\"background-color: #ffffd2;\">mkljun@pim:~$ time php getFavicon.php \r\nhttp:\/\/cdn.sstatic.net\/stackoverflow\/img\/favicon.ico\r\nreal&nbsp;&nbsp;&nbsp; 0m26.881s\r\nuser&nbsp;&nbsp;&nbsp; 0m0.048s\r\nsys&nbsp;&nbsp;&nbsp; 0m0.036s\r\nmkljun@pim:~$ time php getFavicon.php \r\nhttp:\/\/cdn.sstatic.net\/stackoverflow\/img\/favicon.ico\r\nreal&nbsp;&nbsp;&nbsp; 0m21.531s\r\nuser&nbsp;&nbsp;&nbsp; 0m0.052s\r\nsys&nbsp;&nbsp;&nbsp; 0m0.028s\r\nmkljun@pim:~$ time php getFavicon.php \r\nhttp:\/\/cdn.sstatic.net\/stackoverflow\/img\/favicon.ico\r\nreal&nbsp;&nbsp;&nbsp; 0m31.562s\r\nuser&nbsp;&nbsp;&nbsp; 0m0.052s\r\nsys&nbsp;&nbsp;&nbsp; 0m0.024s\r\nmkljun@pim:~$ time php getFavicon2.php \r\nhttp:\/\/cdn.sstatic.net\/stackoverflow\/img\/favicon.ico\r\nreal&nbsp;&nbsp;&nbsp; 0m26.080s\r\nuser&nbsp;&nbsp;&nbsp; 0m0.044s\r\nsys&nbsp;&nbsp;&nbsp; 0m0.008s\r\nmkljun@pim:~$ time php getFavicon2.php \r\nhttp:\/\/cdn.sstatic.net\/stackoverflow\/img\/favicon.ico\r\nreal&nbsp;&nbsp;&nbsp; 0m25.918s\r\nuser&nbsp;&nbsp;&nbsp; 0m0.024s\r\nsys&nbsp;&nbsp;&nbsp; 0m0.028s\r\nmkljun@pim:~$ time php getFavicon2.php \r\nhttp:\/\/cdn.sstatic.net\/stackoverflow\/img\/favicon.ico\r\nreal&nbsp;&nbsp;&nbsp; 0m25.984s\r\nuser&nbsp;&nbsp;&nbsp; 0m0.032s\r\nsys&nbsp;&nbsp;&nbsp; 0m0.020s\r\nmkljun@pim:~$ time php getFavicon3.php \r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [0] =&gt; http:\/\/cdn.sstatic.net\/stackoverflow\/img\/favicon.ico\r\nreal&nbsp;&nbsp;&nbsp; 0m20.954s\r\nuser&nbsp;&nbsp;&nbsp; 0m0.028s\r\nsys&nbsp;&nbsp;&nbsp; 0m0.024s\r\nmkljun@pim:~$ time php getFavicon3.php \r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [0] =&gt; http:\/\/cdn.sstatic.net\/stackoverflow\/img\/favicon.ico\r\nreal&nbsp;&nbsp;&nbsp; 0m26.077s\r\nuser&nbsp;&nbsp;&nbsp; 0m0.032s\r\nsys&nbsp;&nbsp;&nbsp; 0m0.020s\r\nmkljun@pim:~$ time php getFavicon3.php \r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [0] =&gt; http:\/\/cdn.sstatic.net\/stackoverflow\/img\/favicon.ico\r\nreal&nbsp;&nbsp;&nbsp; 0m20.884s\r\nuser&nbsp;&nbsp;&nbsp; 0m0.028s\r\nsys&nbsp;&nbsp;&nbsp; 0m0.028s\r\n<\/pre>\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I recently commented on Alan&#8217;s blog about getting favicon from and URL. The simplest way is getting a domain of an URL and adding &quot;favicon.ico&quot; at the end. The problem arises if: the favicon is not on the root on the host name it has an uncommon name it is not in MS ICO format&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-232","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/pim.famnit.upr.si\/wp\/index.php?rest_route=\/wp\/v2\/posts\/232","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pim.famnit.upr.si\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pim.famnit.upr.si\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pim.famnit.upr.si\/wp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pim.famnit.upr.si\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=232"}],"version-history":[{"count":1,"href":"https:\/\/pim.famnit.upr.si\/wp\/index.php?rest_route=\/wp\/v2\/posts\/232\/revisions"}],"predecessor-version":[{"id":749,"href":"https:\/\/pim.famnit.upr.si\/wp\/index.php?rest_route=\/wp\/v2\/posts\/232\/revisions\/749"}],"wp:attachment":[{"href":"https:\/\/pim.famnit.upr.si\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=232"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pim.famnit.upr.si\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=232"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pim.famnit.upr.si\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=232"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}