How to Auto Post on Blogger with PHP?

Today, We want to share with you How to Auto Post on Blogger with PHP?.In this post we will show you How to post a post in Blogger using PHP?, hear for PHP Automatically Auto post Content into Blogspot we will give you demo and example for implement.In this post, we will learn about Blogspotomatic Automatic Post Generator and Blogspot Auto Poster with an example.

How to Auto Post on Blogger with PHP?

There are the Following The simple About How to Auto Post on Blogger with PHP? Full Information With Example and source code.

As I will cover this Post with live Working example to develop How to create an post entry in blogspot using php?, so the Making Posts on Blogspot Automatically for this example is following below.

Read Also:  Automatic Image slideshow Using PHP

Auto post into Blogspot using php code?

 <?php session_start();
    $email = "[email protected]";
    $pass = "password";
    $blogID= urlencode("YOUR_LIVE_BLOGARRID"); // like 9804924369906987492

    //Please Do Not Modify simple any Below PHP Source Code
    if(!isset($_SESSION['sessionToken'])) {

    $ch = curl_init("https://www.google.com/accounts/ClientLogin?Email=$email&Passwd=$pass&service=blogger&accountType=GOOGLE");
    curl_setopt($ch, CURLOPT_POST,1);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION ,1);
    curl_setopt($ch, CURLOPT_HEADER,0);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER ,1);
    $result = curl_exec($ch);
    $resultArray = curl_getinfo($ch);
    curl_close($ch);
    $arr = explode("=",$result);
    $token = $arr[3];
    $_SESSION['sessionToken'] = $token;
    }

    $entry = "<entry xmlns='http://www.w3.org/2005/Atom'>

    <title type='text'>Welcome to my First Post(Article) - www.pakainfo.com </title>

    <content type='xhtml'>

   pakainfo is the most popular Programming & Web Development blog. Our mission is to provide the best online resources on programming and web development. We deliver the useful and best tutorials for web professionals — developers, programmers, freelancers and site owners. Any visitors of this site are free to browse our tutorials, live demos and download scripts.

    </content>

    </entry>";

    $string_len = strlen($post_entry);

    $read_headers = array("Content-type: application/atom+xml","Content-Length: {$string_len}","Authorization: GoogleLogin auth={$_SESSION['sessionToken']}","$post_entry");

    $live_curl = curl_init();
    curl_setopt($live_curl, CURLOPT_URL, "https://www.blogger.com/feeds/$blogID/posts/default");
    curl_setopt($live_curl, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($live_curl, CURLOPT_TIMEOUT, 4);
    curl_setopt($live_curl, CURLOPT_HTTPHEADER, $read_headers);
    curl_setopt($live_curl, CURLOPT_FOLLOWLOCATION, 1);
    curl_setopt($live_curl, CURLOPT_UNRESTRICTED_AUTH, 1);
    curl_setopt($live_curl, CURLOPT_POST, true);
    $result = curl_exec($live_curl);
    $ERROR_CODE = curl_getinfo($live_curl);
    curl_close($live_curl);
	echo "***********************************";
    echo '<pre>';
    print_r($read_headers);
    var_dump($result);
    print_r($ERROR_CODE);
    exit;
	echo "***********************************";
    ?>

Web Programming Tutorials Example with Demo

Read :

Read Also:  PHP Star Triangle Nested using Foreach Loop

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about simple Auto Post on Blogger with PHP source code?.
I would like to have feedback on my infinityknow.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.