Auto Post into Google Blogspot in PHP

Auto Post into Google Blogspot in PHP

Today, We want to share with you Auto Post into Google Blogspot in PHP.
In this post we will show you Auto Post to Blogspot, hear for Auto post into Blogspot using php code we will give you demo and example for implement.
In this post, we will learn about How to Auto Post on Blogspot with PHP with an example.

How to Auto Post on Blogspot with PHP?

My Paka Knowledgeable Ideas, Tips and Tricks, Useful Content, Jobs, Technology, Earn Money, gmail creation, skype, yahoo and more useful things.

multiple skype accounts – Windows desktop Run Two Skype

blogspot_autopost.php
Auto Post On Blogspot Using PHP

<?php
if (isset($_POST['submit'])) {
 
  // load some libs Zend Gdata libraries
  require_once 'Zend/Loader.php';
  Zend_Loader::loadClass('Zend_Gdata');
  
  //Zend_Gdata_Query
  Zend_Loader::loadClass('Zend_Gdata_Query');
  
  //Zend_Gdata_ClientLogin
  Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
  
  //Zend_Gdata_Feed
  Zend_Loader::loadClass('Zend_Gdata_Feed');
 
  // config settings for google api ClientLogin authentication
  $user = "[email protected]";
  $pass = "google authentication your-password";
 
  // set here your blog id
  $id = 'UNIQ_YOUR-BLOG-ID-HERE';
 
  try {
  
    $users = Zend_Gdata_ClientLogin::getHttpClient(
      $user, $pass, 'blogger');
    $auto_post = new Zend_Gdata($users);
 
     
    $uri = 'http://www.blogger.com/feeds/' . $id . '/posts/default';
    $livePost = $auto_post->newEntry();
    $livePost->title = $auto_post->newTitle($_POST['title']);
    $livePost->content = $auto_post->newContent($_POST['body']);
    $livePost->content->setType('text');
 
 
    $response = $auto_post->insertEntry($livePost, $uri);
    $arr = explode('-', $response->getId());
    $id = $arr[2];
    echo 'Your Blogspot Successfully added post with your ID: ' . $id;
 
  } catch (Exception $e) {
    die('ERROR:' . $e->getMessage());  
  }
}
?>
<html>
  <head><title>Integrate Blogger content with PHP API</title></head>
  <body>
    <h2>Pakainf.com - Add New Post</h2>
    <form method="post">
      Title: <hr/> <input type="text" name="title"
       size="50" /> <hr/>
      Body: <hr/> <textarea name="body" cols="40"
       rows="10"> </textarea> <hr/>
      <input type="submit" name="submit" value="Post" />
    </form>
  </body>
</html>

Auto Post into Google Blogspot in PHP
Auto Post into Google Blogspot in PHP

Read :

Read Also:  update multiple columns sql

Summary

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

I hope you get an idea about blogger api php.
I would like to have feedback on my Pakainfo.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.