How do I get the title of the Facebook video using PHP.
I googled around and could not find any reference so I started trying with Facebook Graph API.
I followed using the sample given in https://developers.facebook.com/docs/graph-api/reference/video
The issue is it requires session tokens in order the get the information.
The code I used:
<?php
require_once('/vendor/facebook/php-sdk-v4/src/Facebook/FacebookRequest.php');
use Facebook\FacebookRequest;
$request = new FacebookRequest(
$session,
'GET',
'/10154392917806729'
);
$response = $request->execute();
$graphObject = $response->getGraphObject();
print_r($response);
?>
The /10154392917806729 is the video ID. It is showing "Undefined variable: session" error.
My guess is I must get the session tokens etc in order for this to work.
Is there any other simplified way? I only want to get the video title given the video url.
Is it possible?
Thanks In Advance