3 # $Id: mkgallery.pl 38 2006-12-17 09:39:01Z crosser $
5 # Build initial (empty) RSS file for mkgallery.pl
7 # Copyright (c) 2007 Eugene G. Crosser
9 # This software is provided 'as-is', without any express or implied
10 # warranty. In no event will the authors be held liable for any damages
11 # arising from the use of this software.
13 # Permission is granted to anyone to use this software for any purpose,
14 # including commercial applications, and to alter it and redistribute it
15 # freely, subject to the following restrictions:
17 # 1. The origin of this software must not be misrepresented; you must not
18 # claim that you wrote the original software. If you use this software
19 # in a product, an acknowledgment in the product documentation would be
20 # appreciated but is not required.
21 # 2. Altered source versions must be plainly marked as such, and must not be
22 # misrepresented as being the original software.
23 # 3. This notice may not be removed or altered from any source distribution.
32 binmode(STDOUT, ":utf8");
34 ######################################################################
41 'rssfile=s'=>\$rssfile,
48 print STDERR <<__END__;
50 --help: print help message and exit
51 --debug: print a lot of debugging info to stdout as you run
52 --rssfile=...: name of the rss file to create
59 print STDERR "you must specify --rssfile\n";
63 my $term = new Term::ReadLine "Edit RSS Attribute";
65 my $rssobj = new XML::RSS (version=>'2.0');
66 die "could not build new RSS object" unless ($rssobj);
68 my $OUT = $term->OUT || \*STDOUT;
69 print $OUT "Enter attributes for this gallery RSS feed\n";
70 my $title = $term->readline('Feed title >','');
71 $term->addhistory($title) if ($title);
72 my $link = $term->readline('Gallery root URL >','');
73 $term->addhistory($link) if ($link);
74 my $desc = $term->readline('Gallery description >','');
75 $term->addhistory($desc) if ($desc);
77 $link .= '/' unless ($link =~ m%/$%);
85 #copyright=>$copyright,
87 #lastBuildDate=>$lastBuild,
89 #managingEditor=>$editor,
90 #webMaster=>$webMaster
92 $rssobj->save($rssfile);