RSS feeds to your webpage [part 1]

So you would like to add some dynamism to your static html pages. Well, ensure your hosted website service provider supports php scripting, which will be strange if they do not.

Download the rss2html file where you will apply your changes to. Download from this location. Unzip this file and add it to the root of your website. Here are your checkpoints:
  1. Ensure your feed is reachable via following link: http://<blogname>.blogspot.com/feeds/posts/default?alt=rss. Ensure you replace <blogname> with your blog name
  2. Modify your rss2html.php file as below:
    • Configuration of RSS2html

      Unzip the folder.  Open the rss2html-docs.txt file in Notepad++ or other plain text editor and read the instructions.  Actually it's very simple to implement by modifying a few lines of code in the rss2html.php file:
    • Tell the script where to find your RSS Feed:

       $XMLfilename = "http://your_blog.blogspot.com/feeds/posts/default?alt=rss";
    • Tell the script where to find your RSS Template on your web site (not blogger):
       
      $TEMPLATEfilename = "http://yourdomain.com/rss2html/sample-template.html";
    • Tell the script how many feed items to display in your HTML page.
      The default value is 1000.  I personally prefer 5 or possibly 10 items max.

      $FeedMaxItems = 10000;
    • Tell your script how many characters to display from your blog post.
      The default value of 0 includes everything.  150 is a nice number.

      $limitItemDescriptionLength = 150;
    • Save sample-template.html and upload to your server.
    • Finally, open your main web site's home page (or whichever page you want the your blogger feed to appear on).  Scroll down to where you want it to display and insert a Server-Side Include pointing to the rss2html.php script.

      <!--#include file="rss2html/rss2html.php" --> 

    • For this to work, you'll need to save your index.html page with a .php or .shtml extension. This is necessary to parse includes on the server.   Delete old index.html page from server.
    • Save rss2html script with a .php extension and upload to your site.

You are now good to go. Have fun peeps.

www.silvafox.co.za

Comments

Popular posts from this blog

Moving Data [Spark Streaming - simple data files]

Notepad++ Regular expressions