Auto Post On Blogspot Using PHP script

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

//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

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.

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!.

Related FAQ

Here are some more FAQ related to this Article:

  1.   Fast Google Adsense Account Approval Process
  2.   Top 10 Ways to Increase Google Adsense Earnings
  3.   Enable Google Shopping Actions Steps
  4.   Auto Post On LinkedIn Using PHP script
  5.   How to Quickly Index New Post In Google Search
  6.   Google AdSense Issues GDPR Recommendations for Publishers
  7.   Quickly Tips To Improve SEO with Increase Google Page Ranking
  8.   Auto Post on Facebook Page using Facebook PHP API
  9.   Login with Facebook using javascript
  10.   Automatically Post On Facebook Using PHP with Graph API