XML::RSS::FromHTML is a simple framework for making RSS out of HTML.
SYNOPSIS
### create your own sub-class, with these four methods
package MyModule;
use base XML::RSS::FromHTML;
sub init {
my $self = shift;
# set your configurations here
$self->name('MyRSS');
$self->url('http://foo.com/headlines.html');
}
sub defineRSS {
my $self = shift;
my $xmlrss = shift;
# define your RSS using XML::RSS->channel method
$xmlrss->channel(
title => 'foo.com headlines feed',
description => 'generated from http://foo.com headlines'
);
}
sub makeItemList {
my $self = shift;
my $html = shift;
# parse HTML and make an item list
my @list;
while ($html =~ m|(.+?)|g){
push(@list,{
link => $1,
title => $2
});
}
return @list;
}
sub addNewItem {
my $self = shift;
my ($xmlrss,$eachItem) = @_;
# make your item using XML::RSS->add_item method
$xmlrss->add_item(
title => $eachItem->{title},
link => $eachItem->{link},
description => 'this is '. $eachItem->{title},
);
}
#### and from your main routine...
package main;
use MyModule;
my $rss = MyModule->new;
$rss->update;
# an updated RSS file './MyRSS.xml' will be created.
# run this script every day, and your RSS will always
# be up-to-date.
Requirements:
· Perl
Product's homepage
Requirements:
· Perl