简体   繁体   English

如何将其放在代码上 https://graph.facebook.com/ql?q=http://google.com

[英]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.

相关问题 getaddrinfo ENOTFOUND https://graph.facebook.com/ - getaddrinfo ENOTFOUND https://graph.facebook.com/ https://graph.facebook.com/me/albums有时不会返回任何内容 - https://graph.facebook.com/me/albums sometimes returns nothing google.com 如何将标签焦点放在不可聚焦的元素上 - how can google.com put a tab focus on an element that is not focusable 尝试通过 node.js http 发布到“graph.facebook.com”时出现“读取 ECONNRESET”错误 - Getting "read ECONNRESET" error when trying to POST to 'graph.facebook.com' via node.js http 匹配[ABC DEF](http://google.com) - Match [ABC DEF](http://google.com) 如何在我的 img src 中传递一个变量,如下所示: <img alt="“阿凡达”" src="`https://graph.facebook.com/${snAvatarSnuid}/picture`"> - How do I pass a variable inside my img src in the following :<img alt=“Avatar” src=`https://graph.facebook.com/${snAvatarSnuid}/picture`> Google.com和DOMContentLoaded - Google.com and DOMContentLoaded 如何从此链接获取 10 (https://google.com/?ib=10) - How to Get 10 from this link (https://google.com/?ib=10) 未捕获的错误:语法错误,无法识别的表达式:测试<a href=“http://google.com”>http://google.com</a>测试 - Uncaught Error: Syntax error, unrecognized expression: test <a href=“http://google.com”>http://google.com</a> test 如果自我===顶部或google.com - if self === top or google.com
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM