Author |
Message |
Tech Support
Joined: 27 Aug 2004
Posts: 804
|
Posted: Sat May 07, 2005 9:29 pm |

|
Simple examples of how to use FeedForAll's fre rss2html.php script:
Contents
Example 1: Running rss2html.php from our web server, using one of our sample templates, to generate a webpage from an RSS feed
Example 2: Running rss2html.php from your web server, using a custom template, to generate a webpage from an RSS feed
Example 3: Using a server side inclusion to insert a RSS feed's contents into an existing webpage
Example 4: Using server side inclusions to insert multiple RSS feeds from other websites, into an existing webpage
Example 1: Running rss2html.php from our web server, using one of our sample templates, to generate a webpage from an RSS feed
Requirements:
None
Steps:
1. Create the following a link on an existing webpage:
http://www.rss2html.com/public/rss2html.php?TEMPLATE=http://www.rss2html.com/public/basic-webpage.html&XMLFILE=(url to your rss feed)
The above link should be all on a single line (no line breaks), and the '(' and ')' characters should not be included. Here the above link, using one of our feeds:
http://www.rss2html.com/public/rss2html.php?TEMPLATE=http://www.rss2html.com/public/basic-webpage.html&XMLFILE=http://www.feedforall.com/blog-feed.xml
Example 2: Running rss2html.php from your web server, using a custom template, to generate a webpage from an RSS feed
Requirements:
PHP 4.x running on your webserver
Steps:
1. Download our free rss2html.php script from: http://www.feedforall.com/download/rss2html.zip
2. Extract the files and put them on your webserver (in a folder that can be accessed from a browser)
3. Edit the existing sample template, or create a new one of your own.
4. Create the following link on an existing webpage:
http://(url to rss2html.php on your web server)?TEMPLATE=(url to your custom template)&XMLFILE=(url to your RSS feed)
The above link should be all on a single line (no line breaks), and the '(' and ')' characters should not be included. Here the above link, using a fancier template file and one of our feeds:
http://www.feedforall.com/rss2html.php?TEMPLATE=http://www.feedforall.com/fancy-sample.html&XMLFILE=http://www.feedforall.com/blog-feed.xml
Example 3: Using a server side inclusion to insert a RSS feed's contents into an existing webpage
Requirements:
PHP 4.x running on your webserver
Server Side Inclusions support on your webserver
Steps:
1. Download our free rss2html.php script from: http://www.feedforall.com/download/rss2html.zip
2. Extract the files and put them on your webserver (in the same folder that your new webpage, and your RSS feed will be in)
3. Create a template for rss2html.php, that will result in the 'guts' of a table.
a. Example:
Code: |
~~~BeginItemsRecord~~~
|
? ?
? ? ? ? ~~~ItemPubShortDate~~~ ~~~ItemPubShortTime~~~
? ? |
? ?
? ? ? ? ~~~ItemTitle~~~
? ? |
? ?
? ? ? ? ~~~ItemDescription~~~
? ? ? ?
? ? ? ?
? ? |
~~~EndItemsRecord~~~
b. Save your template into the same folder as the rss2html.php script and your RSS feed file
4. Create a new webpage that you want your RSS feed displayed in.
a. In the new webpage, create a new table, and put only a server side include command in the table.
b. Example
c. Save your new webpage in the same folder as the rss2html.php script and your RSS feed file
d. Most servers will require you to save the new webpage with .shtml as the extension (instead of .htm or .html), so the server will know to look for SSI commands in the webpage.
Example 4: Using server side inclusions to insert multiple RSS feeds from other websites, into an existing webpage
Requirements:
PHP 4.x running on your webserver
Server Side Inclusions support on your webserver
Steps:
1. Download our free rss2html.php script from: http://www.feedforall.com/download/rss2html.zip
2. Extract the files and put them on your webserver (in the same folder that your new webpage, and your template will be in)
3. Create a template for rss2html.php, that will result in the 'guts' of a table.
a. Example:
Code: |
~~~BeginItemsRecord~~~
|
? ?
? ? ? ? ~~~ItemPubShortDate~~~ ~~~ItemPubShortTime~~~
? ? |
? ?
? ? ? ? ~~~ItemTitle~~~
? ? |
? ?
? ? ? ? ~~~ItemDescription~~~
? ? ? ?
? ? ? ?
? ? |
~~~EndItemsRecord~~~
b. Save your template into the same folder as the rss2html.php script.
4. Create a new webpage that you want your RSS feed displayed in.
a. In the new webpage, create a new table, and put one or more server side include commands in the table.
b. Example
c. Save your new webpage in the same folder as the rss2html.php script and your template.
d. Most servers will require you to name the new webpage with .shtml as the extension (instead of .htm or .html), so the server will know to look for SSI commands in the webpage.
|
_________________
FeedForAll Support
|
|

|
 |
SoulKeeper
Guest
|
Posted: Thu Jun 16, 2005 8:42 pm |

|
is there a way we can call this on a PHP page?
Thanks
|
|
|
|
 |
someone
Joined: 31 Jul 2005
Posts: 2
|
Posted: Sun Jul 31, 2005 3:43 am |

|
Does this script can use this code to include from php files ? :
Code: |
include ("./rss2html.php?TEMPLATE=xxx&XMLFILE=xxx&MAXITEMS=xxx"); |
If not , is there anyway to do it ?
I'm newbie php .
Plz help me !
|
|
|

|
 |
MacSupport
Joined: 24 Feb 2005
Posts: 648
|
Posted: Sun Jul 31, 2005 3:42 pm |

|
someone wrote: |
Does this script can use this code to include from php files ? :
Code: |
include ("./rss2html.php?TEMPLATE=xxx&XMLFILE=xxx&MAXITEMS=xxx"); |
If not , is there anyway to do it ?
I'm newbie php .
Plz help me !
|
If you want to do an include with parameters you would need to do
Code: |
include ("http://your.domain.com/rss2html.php?TEMPLATE=xxx&XMLFILE=xxx&MAXITEMS=xxx"); |
However, since most hosting companies are turning of "allow_fopen_url", this won't work. The safest option is to use Server Side Includes and not a PHP include.
Jim
|
|
|
 
|
 |
snimmons
Joined: 22 Dec 2005
Posts: 5
|
Posted: Thu Dec 22, 2005 8:36 pm |

|
I'm trying the SSI with example 3, but all I get is a code dump of the script in the html, not the coverted RSS. Any ideas what could be wrong?
|
|
|

|
 |
MacSupport
Joined: 24 Feb 2005
Posts: 648
|
Posted: Thu Dec 22, 2005 10:27 pm |

|
snimmons wrote: |
I'm trying the SSI with example 3, but all I get is a code dump of the script in the html, not the coverted RSS. Any ideas what could be wrong? |
First, are you using Apache as your web server?
Are server side includes enabled for the file extension of your page?
Jim
|
|
|
 
|
 |
snimmons
Joined: 22 Dec 2005
Posts: 5
|
Posted: Thu Dec 22, 2005 10:52 pm |

|
|

|
 |
MacSupport
Joined: 24 Feb 2005
Posts: 648
|
Posted: Thu Dec 22, 2005 11:01 pm |

|
snimmons wrote: |
Not sure of the webserver type. I'm using Windows hosting with GoDaddy - I will raise the question with them.
|
If you are using windows hostig then it is most likely running on IIS, and Apache style SSI won't work. PHP is problably your best bet.
snimmons wrote: |
I've tried using a php include on a dummy page and that works fine, I also see the fopen is allowed on the php support (on my godaddy account). |
I get a blank page with your URL too, but when I chage the to use a different server I do get results. Did you edit the script to use fopen? If not change so it does.
snimmons wrote: |
I'm trying to hit the url direct using this: I get an empty (well formed page), but with no links |
The no links is because your template doesn't have links in it.
snimmons wrote: |
http://www.luton-lambeg.org/test/rss2html.php?XMLFILE=http://newsrss.bbc.co.uk/rss/newsonline_uk_edition/northern_ireland/rss.xml&TEMPLATE=http://www.luton-lambeg.org/test/sample-template.html&MAXITEMS=10
I also tried a php page http://www.luton-lambeg.org/test/testpage.php using an include as below (have tried various variants with relative and absolute paths to the script and template.
include("rss2html.php?XMLFILE=http://newsrss.bbc.co.uk/rss/newsonline_uk_edition/northern_ireland/rss.xml&TEMPLATE=sample-template.html&MAXITEMS=10")
?>
Is is ok to use php include given fopen is supported? Any idea then why I'd get a blank page? I tried pointing at other remote RSS feeds and other remote templates and simply calling rss2html from my server, but same result.
Ideas most welcome :-)
thx... |
|
|
|
 
|
 |
snimmons
Joined: 22 Dec 2005
Posts: 5
|
Posted: Thu Dec 22, 2005 11:22 pm |

|
Have reverted to the sample template in the download zip file, which now includes links. Have set $useFopenURL = 1; in the php script. These are published on the web server, but I still get blank page on a direct URL hit, and obviously therefore no html where I try to insert the RSS feed.
Anything I can check / try?
thx...
|
|
|

|
 |
MacSupport
Joined: 24 Feb 2005
Posts: 648
|
Posted: Fri Dec 23, 2005 1:28 am |

|
|
 
|
 |
snimmons
Joined: 22 Dec 2005
Posts: 5
|
Posted: Fri Dec 23, 2005 7:02 pm |

|
Thanks for the assistance. I tried a couple of other similar php scripts for the same purpose and they all returned nothing as well. I tried CARP which indicated to me that fopen and fsockopen were not working correctly. I see on the GoDaddy hosting plans some differences in the php support on Windows and Linux. I also gave a couple of .asp solutions a whirl, but no joy. Rather than slog along, I've decided to move the hosting plan onto Linux, which I think has a better chance of success. That takes approx 72 hours - so enough time to eat lots of Xmas food and then come back to it :-)
A couple of things might be useful to add:
1. Something like CARP has to check PHP support on the target server to indicate if your php script will (or should work)?
2. A debug version of the script, with some additional echo statements and a $debug={0,1} variable to control operation. I wrote some diagnostics in to see where the script tanked, perhaps one to consider for tracing issues?
Anyway I give it a try in a day or 2 on Linux and fingers crossed :-)
|
|
|

|
 |
MacSupport
Joined: 24 Feb 2005
Posts: 648
|
Posted: Fri Dec 23, 2005 7:13 pm |

|
snimmons wrote: |
Thanks for the assistance. I tried a couple of other similar php scripts for the same purpose and they all returned nothing as well. I tried CARP which indicated to me that fopen and fsockopen were not working correctly. I see on the GoDaddy hosting plans some differences in the php support on Windows and Linux. I also gave a couple of .asp solutions a whirl, but no joy. Rather than slog along, I've decided to move the hosting plan onto Linux, which I think has a better chance of success. That takes approx 72 hours - so enough time to eat lots of Xmas food and then come back to it :-)
A couple of things might be useful to add:
1. Something like CARP has to check PHP support on the target server to indicate if your php script will (or should work)?
2. A debug version of the script, with some additional echo statements and a $debug={0,1} variable to control operation. I wrote some diagnostics in to see where the script tanked, perhaps one to consider for tracing issues?
Anyway I give it a try in a day or 2 on Linux and fingers crossed :-) |
You are not the first person to mention on this forum that they needed to switch from GoDaddy Windoze to Linux.
The newest versions of the script have an option "?buildURL" that helps to make sure the URLs that are passed to it are properly encoded. The is also useful for general debugging to make sure you are able to read the feed.
Jim
|
|
|
 
|
 |
snimmons
Joined: 22 Dec 2005
Posts: 5
|
Posted: Sat Dec 24, 2005 7:58 am |

|
I'm now on Linux and the script worked first try (hooray!). The conclusion therefore if you're struggling on GoDaddy Windows hosting would be to move to Linux. The PHP support is different across the different OS. Of course everyone should consider on a case by case basis whether this move would be suitable based on their other requirements (i.e. not using asp for example).
Thanks for your help, I look forward to using this on the site now and experimenting further.
|
|
|

|
 |
Becky Lash
Joined: 13 Apr 2005
Posts: 21
Location: Huntsville, AL
|
Posted: Wed Feb 01, 2006 10:45 pm |

|
I am struggling with how to store the information. Does Google care if the information is stored in XML versus .html tags?
Are there any advantages for using PHP pages over .html pages that would refer to the PHP page?
Thanks for any thoughts or feedback.
Becky
|
_________________
www.epictrends.com
|
|
 
|
 |
MacSupport
Joined: 24 Feb 2005
Posts: 648
|
Posted: Wed Feb 01, 2006 10:49 pm |

|
Becky Lash wrote: |
I am struggling with how to store the information. Does Google care if the information is stored in XML versus .html tags?
Are there any advantages for using PHP pages over .html pages that would refer to the PHP page?
Thanks for any thoughts or feedback.
Becky |
I don't know if Google cares if it is .html, .shtml, .php or the "I am too lazy to type the "l" .htm extension. If you want all .html files the apache server can be configured to process PHP in .html files. And the magic is to add the following line to your .htaccess file
AddType application/x-httpd-php php php3 html shtml
Jim
|
|
|
 
|
 |
|