Skúšal som vytiahnuť počet komentárov zo stránky
http://example.com/, žiaľ nedarí sa mi.
Kód:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en" xmlns:fb="http://ogp.me/ns/fb#">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>new_file</title>
</head>
<body>
<div id="fb-root"></div>
<script>
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_GB/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>
<fb:comments-count href=http://example.com/></fb:comments-count> awesome comments
</body>
</html>
Je tam zopár komentárov, takže malo by tam byť nejaké číslo :
https://graph.facebook.com/?ids=http://example.com Viem to vytiahnuť v php spôsobom :
Kód:
$filecontent = file_get_contents('https://graph.facebook.com/?ids=' . $url);
$json = json_decode($filecontent);
$count = $json->$url->comments;
if($count != NULL)
return $count;
Ale v tom html ani za pána. Máte niekto s tým skúsenosti ?