How to show post from Blogger on your website

Show Blogger content on Your Website

I was recently working on a website in Open source and blog of that site was being managed on Blogger.com, in general case when blog is self hosted on same domain or is in WordPress is become quite easy to show the post on the website. Here also the same requirement was faced where I had to show the blog post on website but from blogger.com

Initially is sounded something quite complex due to my limited exposure with blogger but once I checked the post structure it become quite easy to achieve this. I did this using MagpieRSS, a free to use open source project for converting various types of RSS feed. I support Blogger too. Step by step process to achieve this is as below:

Step 1: Download Magpie RSS

Step 2: Extract downloaded files in a directory named magpierss in ROOT of your project.

Step 3: Open PHP page where we need to display list of post from blogger and paste below code, I assume you :
{code}

{/code}
Now we have to display post data fetched from blogger:

a. If you want to display POST TITLE along with DESCRIPTION from blogger on your website, use below code:
{code}
items[0];
$content = $item[‘atom_content’];
echo “

Latest Blog Entry:
$content

\n”;
?>
{/code}
b. If you want to display POST TITLE ONLY from blogger on your website, use below code:
{code}
Latest blog additions:\n”;

foreach ($rss->items as $item) {
$href = $item[‘link’];
$title = $item[‘title’];
$created = $item[‘created’];

echo “

  • $title $created
  • \n”;
    }
    echo “

    “;
    ?>
    {/code}
    c. b. If you want to display ‘N’ number of POST TITLE from blogger on your website, a small change in above code is required and it will be as below:
    {code}
    Latest blog additions

      “;
      define(‘MAGPIE_DIR’, ‘magpierss/’);
      require_once(MAGPIE_DIR.’rss_fetch.inc’);

      $num_items = 7; // Number of post we wish to display
      $rss = fetch_rss( ‘http://yourblogname.blogspot.com/atom.xml’ );
      $items = array_slice($rss->items, 0, $num_items);

      foreach ($items as $item) {
      $href = $item[‘link’];
      $title = $item[‘title’];
      echo “

    • $title
    • \n”;
      }
      echo “

    “;
    ?>
    {/code}

    I am a Technical consultant with over 16 years of experience in developing, leading, and consulting on various web and mobile applications for startups and businesses. My core competencies include open-source frameworks, PHP, Marketo, WordPress and Digital Marketing Strategy. I am also a certified Microsoft Professional and a graduate of the Executive Program in Digital and Social Media Marketing from IIM Raipur. I lead a team of talented and passionate developers, designers, and marketers who deliver innovative and impactful solutions for our clients. We work with the latest technologies and methodologies, such as AI, cloud computing, agile, and DevOps, to create user-friendly, scalable, and secure products that meet the needs and expectations of our customers.

    More Posts - Twitter - LinkedIn - Google Plus