Código PHP:
<?php
$query = urlencode("select commentsbox_count from link_stat where url = 'http://techcrunch.com/2012/03/31/dramacrunch/'");
$response = json_decode(file_get_contents("https://graph.facebook.com/fql?q=$query"), TRUE);
if(!empty($response['data'][0]['commentsbox_count'])) {
echo $response['data'][0]['commentsbox_count'] . " comments were found!";
}
?>
Código PHP:
<?php
$url = urlencode(get_permalink($post->ID));
$query = urlencode("select commentsbox_count from link_stat where url = '$url'");
$response = json_decode(file_get_contents("https://graph.facebook.com/fql?q=$query"), TRUE);
echo $response['data'][0]['commentsbox_count'];
?>
Warning: file_get_contents() [function.file-get-contents]: php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in /www/patricioherrera.com.ar/htdocs/wp-content/themes/ph/index.php on line 50
Warning: file_get_contents(https://graph.facebook.com/fql?q=select+commentsbox_count+from+link_stat+wher e+url+%3D+%27http%253A%252F%252Fpatricioherrera.co m.ar%252Fwork-number-3%252F%27) [function.file-get-contents]: failed to open stream: php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in /www/patricioherrera.com.ar/htdocs/wp-content/themes/ph/index.php on line 50
La línea 50 es esta:
Código PHP:
$response = json_decode(file_get_contents("https://graph.facebook.com/fql?q=$query"), TRUE);
Estoy cometiendo algún error al modificarlo?
Muchas gracias.