NAME
HTML::Latemp::News - News Maintenance Module for Latemp (and possibly other web frameworks)
SYNOPSIS
#!/usr/bin/perl
use strict;
use warnings;
use MyManageNews;
my @news_items =
(
.
.
.
);
my $news_manager =
HTML::Latemp::News->new(
'news_items' => \@news_items,
'title' => "Better SCM News",
'link' => "http://better-scm.berlios.de/",
'language' => "en-US",
'copyright' => "Copyright by Shlomi Fish, (c) 2005",
'webmaster' => "Shlomi Fish <shlomif\@iglu.org.il>",
'managing_editor' => "Shlomi Fish <shlomif\@iglu.org.il>",
'description' => "News of the Better SCM Site - a site for Version Control and Source Configuration Management news and advocacy",
);
$news_manager->generate_rss_feed(
'output_filename' => "dest/rss.xml"
);
1;
DESCRIPTION
This is a module that maintains news item for a web-site. It can generate an RSS feed, as well as a news page, and an HTML newsbox, all from the same data.
FUNCTION
HTML::Latemp::News->new(...)
This is the constructor for the news manager. It accepts the following named parameters:
- 'news_items'
-
This is a reference to a list of news_items. See below.
- 'title'
-
The title of the RSS feed.
- 'link'
-
The link to the homepage of the site.
- 'language'
-
The language of the text.
- 'copyright'
-
The copyright notice of the text.
- 'webmaster'
-
The Webmaster.
- 'managing_editor'
-
The managing editor.
- 'description'
-
A description of the news feed as will be put in the RSS feed.
Format of the news_items
The news_items is a reference to an array, of which each element is a hash reference. The hash may contain the following keys:
- 'title'
-
The title of the item.
- 'id'
-
The ID of the item. This will also be used to calculate URLs.
- 'description'
-
A text description explaining what the item is all about.
-
The author of the item.
- 'date'
-
A string representing the daet.
- 'category'
-
The cateogry of the item.
$news_manager->generate_rss_feed('output_filename' => "rss.xml")
This generates an RSS feed. It accepts two named arguments. 'output_filename'
is the name of the RSS file to write to. 'num_items'
is the number of items to include, which defaults to 10.
$news_manager->get_navmenu_items('num_items' => 5)
This generates navigation menu items for input to the navigation menu of HTML::Widgets::NavMenu. It accepts a named argument 'num_items'
which defaults to 10.
$news_manager->get_news_page_entries('num_items' => 5)
This generates HTML for the news page.
$news_manager->get_news_box('num_items' => 5)
This generates an HTML news box with the recent headlines.
AUTHOR
Shlomi Fish, <shlomif@iglu.org.il>
BUGS
Please report any bugs or feature requests to bug-html-latemp-news@rt.cpan.org
, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=HTML-Latemp-News. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
SEE ALSO
XML::RSS, HTML::Widgets::NavMenu.
ACKNOWLEDGEMENTS
COPYRIGHT & LICENSE
Copyright 2005 Shlomi Fish, All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under the terms of the MIT X11 license.