Rss-->html script?

apps

#1

Anyone know if Dreamhost has a script in place to convert an RSS feed into html? I’d like to change our newposts, which are currently manually entered into an embedded html page, into an RSS feed that can be coded into said html doc…

Any links to info on the script or help in setting it up would be greatly appreciated. Thanks!

No one deserves mime, Buffy.


#2

I am only posting this as an example of what will work as it is primitive. Intended only to give you an idea of what you can do. If you have an xml example and know what you want out of the feed, it would only take me a minute to modify what I have already written and email it to you. Not looking for anything but a thank you as it would take only a few minutes.

BTW: A bit of this will get hacked by the forum as it contains HTML

ajdrew@(SPAMSUCKS)pagannation.com

#!/usr/bin/perl

use XML::RSS;
use LWP::Simple;

$html_line = "News

";

Repeat the following two lines for each feed you want.

$url = “www.whatever.com/news.xml”;
&get_rss;

sub get_rss {
my $rss = new XML::RSS;
$content = get($url);
$rss->parse($content);

foreach my $item (@{$rss->{‘items’}}) {
next unless defined($item->{‘title’}) && defined($item->{‘link’});
$link = $item->{‘link’};
($link = $link) =~ s/#.*//i;
$title = $item->{‘title’};
$html_line = "$html_line

print “Content-type: text/html\n\n”;
print $html_line;