[英]How to put this on code https://graph.facebook.com/ql?q=http://google.com
(PLEASE DON'T CLICK NEGATIVE/DOWN RATE. I NEED ANSWER TO THIS. THANK YOU) (请不要点击负/降价。我需要回答这个问题。谢谢)
Im very new in coding + learning i wanted to edit the code that i have in my site this code/link https://graph.facebook.com/fql?q=http://google.com
was already deprecated.我在编码 + 学习方面很新,我想编辑我网站上的代码,此代码/链接https://graph.facebook.com/fql?q=http://google.com
已被弃用。 However, i found new updated code/link which is https://graph.facebook.com/?id=http://google.com
但是,我发现了新的更新代码/链接https://graph.facebook.com/?id=http://google.com
Now here is the code the requires editing:现在这里是需要编辑的代码:
public function getFacebookData($domain) { try { $callback_url = "https://graph.facebook.com/fql?"; $data = array( 'q' => "SELECT comment_count, like_count, share_count FROM link_stat WHERE url='$domain'" );$curl_response = $this->curl->get($callback_url . http_build_query($data, '', '&')); if ($curl_response->headers['Status-Code'] == "200") { $parse_response = json_decode($curl_response, true); $fb_share_count = $parse_response['data'][0]['share_count']; $fb_like_count = $parse_response['data'][0]['like_count']; $fb_comment_count = $parse_response['data'][0]['comment_count']; } else { $fb_share_count = 0; $fb_like_count = 0; $fb_comment_count = 0; } $response = array( 'status' => 'success', 'data' => array( 'fb_share_count' => filter_var($fb_share_count, FILTER_SANITIZE_NUMBER_INT), 'fb_like_count' => filter_var($fb_like_count, FILTER_SANITIZE_NUMBER_INT), 'fb_comment_count' => filter_var($fb_comment_count, FILTER_SANITIZE_NUMBER_INT) ) ); } catch (Exception $e) { $response = array( 'status' => 'error', 'msg' => $e->getMessage() ); } return $response; }
change your callback_url in code to将代码中的 callback_url 更改为
$callback_url = " https://graph.facebook.com/v2.2/ ?" $callback_url = " https://graph.facebook.com/v2.2/ ?"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.