Hugh Esco > WWW-Scrape-Mailman-RSS > WWW::Scrape::Mailman::RSS

Download:
WWW-Scrape-Mailman-RSS-0.12.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.12   Source  

NAME ^

WWW::Scrape::Mailman::RSS - Parse mailman listserve archives, format as an rss feed

VERSION ^

Version 0.12

SYNOPSIS ^

On some convenient server to host your rss feeds, schedule the following script as a cron job at some appropriate interval:

    #!/usr/bin/perl
    use strict;
    use warnings;
    use WWW::Scrape::Mailman::RSS;
    my $feed = WWW::Scrape::Mailman::RSS->new(
       'rss_version' => '0.91',
             'debug' => 0, # try values from 1 to 5 for noisier output
       );

    my %args = (
         'info_url' => 'http://ga.greens.org/mailman/listinfo/gpga-news',
         'base_url' => 'http://ga.greens.org/pipermail/gpga-news',
        'list_name' => 'gpga-news',
         'audience' => 'Greens',
      'description' => 'News by, about and for Greens',
           'cycles' => 2,
      'output_file' => '/home/hesco/sites/news.tns.campaignfoundations.com/gpga_news_feed.html',
       'rss_output' => '/home/hesco/sites/news.tns.campaignfoundations.com/gpga_news_feed.rss',
      );

    $feed->render_feed(\%args);

    # create additional feeds for other lists here

    1;

Then on your site, set your feed aggregator to point to: http://news.tns.campaignfoundations.com/gpga_news_feed.rss

METHODS ^

WWW::Scrape::Mailman::RSS->new( \%defaults )

Given a hashref of defaults which includes the key 'rss_version', construct and returns a $feed object, including embedded objects for WWW::Mechanize, HTML::TableExtract, XML::Twig and XML::RSS. If $defaults->{'debug'} is set, you can see debugging output; with the noise level increasing as you increment it from 1 to 5.

$self->render_feed ( \%args )

Given a $feed object and a hashref of arguments, including list_name, info_url, description, base_url, cycles and rss_output, download, process and render as an rss feed the most recent $args->{'cycles'} cycles of a mailman list's public archives.

$self->_parse_mm_archive_cycle ( \%args, '2010-September' );

Given the arguments passed to ->render_feed, plus the cycle name (month has been tested, week and quarter have not yet been tested), get the appropriate date.html page from a mailman list serve's archives, parse it and use the data collected to add items to an rss feed of the data.

AUTHOR ^

Hugh Esco, <hesco at campaignfoundations.com>

BUGS ^

* First item from each cycle is missing from feed.

Please report any bugs or feature requests to bug-www-scrape-mailman-rss at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=WWW-Scrape-Mailman-RSS. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT ^

You can find documentation for this module with the perldoc command.

    perldoc WWW::Scrape::Mailman::RSS 

You can also look for information at:

ACKNOWLEDGEMENTS ^

With appreciation to Adam Shand <adam@spack.org>, whose mm2rss.pl script served as inspiration for refactoring a private module CF::mmFeedParser which I wrote years ago. His code also introduced me to XML::RSS with which I had not previously been familiar.

COPYRIGHT & LICENSE ^

Copyright 2010-2011 Hugh Esco.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 dated June, 1991 or at your option any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

A copy of the GNU General Public License is available in the source tree; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

syntax highlighting: