I want to post to Blogger with label and search description. I got a link from google https://github.com/google/google-api-php-client/blob/master/src/Google/Service/Blogger.php
$scriptUri = "https://".$_SERVER["HTTP_HOST"].$_SERVER['PHP_SELF'];
require_once 'google-api-php-client-master/src/Google/autoload.php';
$client = new Google_Client();
$client->setApplicationName("BloggerAPI");
$client->setDeveloperKey("AIzaSysdCMlzJM2SsdxuEEdS-l9r2MxLgcfxylE2Bzc");
$client->setAccessType('online');
$client->setClientId("699839154993-7423kasdsdeibmi00ss1bk94plu5gi7ioene.apps.googleusercontent.com");
$client->setClientSecret("82cVvhOy5z3hsW2Ur4fgdfg8QXaBR");
$client->setRedirectUri($scriptUri);
$client->setScopes(array('https://www.googleapis.com/auth/blogger')); //since we are going to use blogger services
$bloggerService = new Google_Service_Blogger($client);
if (isset($_GET['logout'])) { // logout: destroy token
unset($_SESSION['token']);
die('Logged out.');
}
if (isset($_GET['code'])) { // we received the positive auth callback, get the token and store it in session
$client->authenticate($_GET['code']);
$_SESSION['token'] = $client->getAccessToken();
}
if (isset($_SESSION['token'])) { // extract token from session and configure client
$token = $_SESSION['token'];
$client->setAccessToken($token);
}
if (!$client->getAccessToken()) { // auth call to google
$authUrl = $client->createAuthUrl();
header("Location: ".$authUrl);
die;
}
$posts = $bloggerService->posts;
$NewPost = new Google_Service_Blogger_Post();
$NewPost->setTitle("Post Title ".time());
$NewPost->setLabels("Post Label1");
$NewPost->setContent("Post Content!!!!");
$NewPost->setCustomMetaData("Custom Meta Data ".time());
try
{
$nposts = $posts->insert("310034677540144362",$NewPost);
}
catch(Exception $e)
{
print_r($e);
}
After this post, then i logged into blogger. I can see the above post there. With this post has 'Post Title' and 'Post Body', but it has no 'label' and 'Search description'.
How can i post with 'label' and 'Search description'?
Is it possible?