rss2html Docs
rss2html Docs
2
Introduction
Uses
Templates
Special variables:
<HTML>
<HEAD>
<TITLE>~~~FeedTitle~~~</TITLE>
</HEAD>
<BODY>
<H1>~~~FeedTitle~~~</H1>
<BR>
<H2>~~~FeedDescription~~~</H2>
<BR>
<TABLE width="100%">
~~~BeginItemsRecord~~~
<TR>
<TD>
<B>~~~ItemTitle~~~</B>
</TD>
</TR>
<TR>
<TD>
~~~ItemDescription~~~
</TD>
</TR>
<TR>
<TD>
<BR>
</TD>
</TR>
~~~EndItemsRecord~~~
</TABLE>
</BODY>
</HTML>
<TABLE WIDTH="100%">
~~~BeginItemsRecord~~~
<TR VALIGN="TOP">
<TD>
<BR>
<FONT SIZE="-1">~~~ItemPubShortDate~~~ </FONT><BR>
<B>~~~ItemTitle~~~</B><BR>
~~~ItemDescription~~~<BR>
<BR>
<A HREF="~~~ItemLink~~~">more info</A>
<BR><BR>
</TD>
</TR>
~~~EndItemsRecord~~~
</TABLE>
If your webserver doesn't support PHP, then you can run the
rss2html.php script on FeedForAll's public server instead. All you need
to do is setup a link on your website to access the script and resulting
webpage.
Syntax:
http://scripts.rss2html.com/public/rss2html.php?
XMLFILE=<your-rss-feed>&TEMPLATE=<your-
template>&MAXITEMS=<max-items>
Replace '<your-rss-feed>' with the full URL to your RSS feed (i.e.
http://www.mydomain.com/myfeed.xml)
Sample:
http://scripts.rss2html.com/public/rss2html.php?
XMLFILE=http://www.feedforall.com/blog-
feed.xml&TEMPLATE=http://www.feedforall.com/samplefeedte
mplate.htm
Replace '<your-rss-feed>' with the full URL to your RSS feed (i.e.
http://www.mydomain.com/myfeed.xml)
Sample:
http://feedforall.com/rss2html.php?XMLFILE=blog-
feed.xml&TEMPLATE=samplefeedtemplate.htm&MAXITEMS=10
With a text editor open up the rss2html.php file. Look for the line near
the beginning that looks like this:
$XMLfilename = "sample.xml";
Replace sample.xml with either the local path or full URL to your RSS
feed file.
$TEMPLATEfilename = "BasicWebpage.htm";
$FeedMaxItems = 10000;
Save the file with a new name (what you want to call it on your
website), but make sure to keep the .php extension.
For example, if you named it 'myfeed.php', you can now access it from
your browser by typing:
Sample:
http://www.feedforall.com/blog.php
Advanced Notes:
Version 2.0 and later of this script use the PHP curl function to
open feeds and templates. Earlier versions used fopen. If you need to
use fopen for any reason, there is a setting at the beginning of the
script that can be changed, to force that behavior.
% -> %2525
? -> %3f
& -> %26
= -> %3d
+ -> %2b
<SPACE> -> %20
http://www.mynewssource.com/opensearch.php?
query=pike+fishing&search=Search&type=search
http://www.rss2html.com/public/rss2html.php?
XMLFILE=http://www.mynewssource.com/opensearch.php
%3fquery%3dpike%2bfishing%26search%3dSearch%26type
%3dsearch
http://scripts.rss2html.com/public/rss2html.php?buildURL
This will bring up a simple form asking you to enter the URL or
filenames for the RSS feed and your HTML template file. You can also
limit the number of items and prevent items with pubDate in the
future from being displayed. After pressing Submit the program will
try and open the RSS feed and HTML template and report errors if any
are found. It will show the URLs with any required encodings and the
code to include the feed in a web page.