Auto Post On Blogspot Using PHP script

Auto Post On Blogspot Using PHP script

Today, We want to share with you Auto Post On Blogspot Using PHP script.
In this post we will show you Automatically Post Content To Blogspot Using PHP, hear for Automatically post to a Blogspot page using the Blogspot PHP API we will give you demo and example for implement.
In this post, we will learn about Automatically Post Content To Blogspot Using PHP with an example.

How to Auto Post on Blogspot with PHP Example

This Offical document Learn how to get step by step How to Auto Post on Blogspot with PHP started using the Blogger API.Blogger API

Also Read :  PHP Auto post Blogger Scripts Example

//Dynemic generate return URL
$redirct_url = "https://".$_SERVER["HTTP_HOST"].$_SERVER['PHP_SELF'];
//include all libs using google
require_once 'google-api-php-client-master/src/Google/autoload.php'; 

$google_clnt = new Google_Client();

$google_clnt->setScopes(array('')); //since we are going to use blogger services

$bloggerService = new Google_Service_Blogger($google_clnt);

if (isset($_GET['logout'])) { // Google logout: Your destroy token
 die('Good Luck Logged out.');

if (isset($_GET['code'])) { // we get the positive google auth callback, get the simple google auth token and some store it in session
	$_SESSION['token'] = $google_clnt->getAccessToken();

if (isset($_SESSION['token'])) { // extract get token from session and configure google_clnt
	$get_token = $_SESSION['token'];

if (!$google_clnt->getAccessToken()) { // Your auth call to google
	$authUrl = $google_clnt->createAuthUrl();
	header("Location: ".$authUrl);

$posts = $bloggerService->posts;

$LivePost = new Google_Service_Blogger_Post();
$LivePost->setTitle("WRITE_YOUR_POST_TITLE ".time());
$LivePost->setCustomMetaData("YOUR_CUSTOM_META_DATA ".time());

	$nposts = $posts->insert("4842995321113595808",$LivePost);
catch(Exception $e)
	//generate Error

Auto Post to Blogger with Title , post label and search some description using Blogger PHP Script API v 3.0

Also Read :  Auto Post On LinkedIn Using PHP script

And then this post, After that We logged into blogger on Google Product. I can display the above post title and description there. With this auto post has successfully upload ‘Post Title’ as well as ‘Post Body’.

Adding a post : Auto Post On Blogspot Using PHP

We can Simple Add an Auto post for a google product blog by sending a POST All the data request to the using post Methods collection URL with a post Simple JSON body:

Auto Post On Blogspot Using PHP : Request

Authorization: /* get here Google OAuth 2.0 token here */
Content-Type: application/json

  "kind": "blogger#post",
  "blog": {
    "id": "4842995321113595808"
  "title": "My First Auto Post On Blogspot Using PHP Example ",
  "content": "Welcome <h2></h2> You Are Always Welcome..."

We must be Google authenticated to Add a Auto post on The Google Blogger.

Also Read :  Login with Facebook using javascript

We hope you get an idea about Auto post into Blogspot using php Source code
We would like to have feedback on my Information blog .
Your valuable any feedback, Good question, Inspirational Quotes, or Motivational comments about this article are always welcome.
If you liked this post, Please don’t forget to share this as Well as Like FaceBook Page.

We hope This Post can help you…….Good Luck!.

Gondaliya Jaydeep

Hi, I’m Jaydeep Gondaliya, PHP is the most popular Programming & Web Development blog. Our mission is to provide the best online resources on programming and web development.Any visitors of this site are free to browse our tutorials, live demos, Examples and download scripts.If you have a project that you want to get started, launch quickly, contact me. Email : [email protected]

Leave a Reply

  • (will not be published)