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 --incpath: do not try to find .include diretory upstream, use
52 specified path (absolute or relavive). Use with causion.
53 --debug: print a lot of debugging info to stdout as you run
54 --asktitle: ask to edit album titles even if there are ".title" files
55 --noasktitle: don't ask to enter album titles even where ".title"
56 files are absent. Use partial directory names as titles.
57 --rssfile=...: build RSS feed for newly added "albums", give name of rss file
64 print STDERR "you must specify --rssfile\n";
68 my $term = new Term::ReadLine "Edit RSS Attribute";
70 my $rssobj = new XML::RSS (version=>'2.0');
71 die "could not build new RSS object" unless ($rssobj);
73 my $OUT = $term->OUT || \*STDOUT;
74 print $OUT "Enter attributes for this gallery RSS feed\n";
75 my $title = $term->readline('Feed title >','');
76 $term->addhistory($title) if ($title);
77 my $link = $term->readline('Gallery root URL >','');
78 $term->addhistory($link) if ($link);
79 my $desc = $term->readline('Gallery description >','');
80 $term->addhistory($desc) if ($desc);
88 #copyright=>$copyright,
90 #lastBuildDate=>$lastBuild,
92 #managingEditor=>$editor,
93 #webMaster=>$webMaster
95 $rssobj->save($rssfile);