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}

    Show External RSS in WordPress Page

    Recently in one of project there was a requirement to show data from a RSS link on a wordpress page along with formatting and other features.

    Implementation of RSS using PHP is quite easy using RSS reader but implementation of same using wordpress plugin involves a bit complexity and for any wordpress lover first thought in mind if for any such available wordpress plugin. I found one such plugin and as author or this seems not continuing support for this wordpress RSS feed reader plugin so I thought to add it library and share with users.

    You may download Rss Feed List Plugin here, steps for integration are as below:

    1. Upload plugin and activate

    2. Create page for RSS Feed

    3. Add below code to page:

    For EACH RSS Feed you wish to add, the options are quite self explanatory, there are more such as adding custom tags before and after each item in the list, by default there is “li>” before and “/li>” after each entry.

    After you’ve saved and published the page, you can check to see if it’s worked.

    You may view a sample page here. This example display data from Networkers.

    Happy Coding!!