Adding an RSS feed
Adding
News feeds to websites keeps content updated automatically since you are
‘streaming’ directly from the news from another website! You just need to be
familiar with a little php and HTML.
To
get started with reading an RSS feed, you need to download the package RSS2HTML.
You
can download the RSS2HTML package from http://www.feedforall.com/download/rss2html.zip
. Once you unzip the files, upload the php file rss2html.php to your server.
RSS2HTMl
uses templates to define how the news feed should be displayed, so you will also
have to upload the template file included in the package. Once those files has
been uploaded, loading an RSS file is easy!
Choose
the HTML file you would like the RSS file to be loaded in, and rename the file
to have an extension of .php instead of .htm
Then Include the code snippet below in your new php file
*MAKE SURE ITS ON ONE LINE*
<?php
include(‘http://www.yoursever.com/rss2html.php?XMLFILE=http://www.searchenginewatch.c
om/sew.xml&TEMPLATE=http://www.yoursever.org/template1.html&MAXITEMS=20
target="_blank">'); ?>
Let me
explain., the first URL rss2html.php, is the path where you have uploaded your
rss2html file;
the
XMLFILE variable is the URL of the RSS
news feed,
the
TEMPLATE variable contains the URL of the
template which defines how the news feed should be displayed. You can edit this
in notepad if you want.
The
MAXITEM variable
defines how many items in the RSS feed should be displayed. (For more
information about items in news feeds, consult the ‘Making an RSS feed’
article)
That’s
all there is to it! The php file should read the XML file and display the
contents using the template file.
If
you have any problems with the above code please email me at kallman at
gmail.com