我必须从facebook页面解析评论。我已将数据存储在$graphObject
中,但它不会通过它解析数据并返回以下错误
注意:未定义的变量:第92行的C:\ xampp \ htdocs \ facebook \ index.php中的会话
致命错误:在第97行的C:\ xampp \ htdocs \ facebook \ index.php中调用未定义的方法Facebook \ FacebookRequest :: execute()
以下是代码
require_once __DIR__ . '/path/to/php-graph-sdk-5.0.0/src/Facebook/autoload.php';
include('path/to/php-graph-sdk-5.0.0/src/Facebook/FacebookRequest.php');
include('path/to/php-graph-sdk-5.0.0/src/Facebook/FacebookApp.php');
include('path/to/php-graph-sdk-5.0.0/src/Facebook/FacebookBatchRequest.php');
include('path/to/php-graph-sdk-5.0.0/src/Facebook/FacebookClient.php');
include('path/to/php-graph-sdk-5.0.0/src/Facebook/SignedRequest.php');
include('path/to/php-graph-sdk-5.0.0/src/Facebook/Authentication/AccessToken.php');
include('path/to/php-graph-sdk-5.0.0/src/Facebook/Facebook.php');
include('path/to/php-graph-sdk-5.0.0/src/Facebook/GraphNodes/GraphUser.php');
include('path/to/php-graph-sdk-5.0.0/src/Facebook/GraphNodes/GraphObject.php');
use Facebook\FacebookRequest;
use Facebook\Facebook;
$request = new FacebookRequest(
$session,
'GET',
'/{page_id}_{post_id}/comments'
);
$response = $request->execute();
$graphObject = $response->getGraphObject();
我不知道这里需要哪个库。请帮助