7 $rssurl = "http://tombo.sourceforge.jp/tombo.rdf";
8 $toppage = "http://tombo.sourceforge.jp";
9 $description = "メモ管理ツールTOMBO リリース情報、お知らせ等を提供しています";
11 if ($#ARGV != 0 || !-d $ARGV[0]) {
12 print "Usage : rssgen.pl <TMPLDIR>\n";
18 opendir(DIR, "$srcdir/news") || die;
19 my @l = sort( { $b <=> $a } readdir(DIR));
26 my $f, $d, $t, $sec, $headline, $cat, $dum;
29 next if ($f eq "." || $f eq "..");
30 next unless ($f =~ /^([0-9]{4})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})\.txt$/);
31 last if ($i > $max_rss_items);
37 open(F, "$srcdir/news/$f") || die;
42 $cat = <F>; chop($cat); # category
43 $dum = <F>; # skip blank line
51 my @itm = ($d, $t, $sec, $headline, $desc, $cat);
58 ($d, $t, $sec, $headline, $desc, $cat) = @{$i};
59 # print "$d $t $sec $headline \n";
63 open(RSS, "| nkf -w > $srcdir/$rssfile") || die;
65 <?xml version="1.0" encoding="utf-8" ?>
67 xmlns="http://purl.org/rss/1.0/"
68 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
69 xmlns:dc="http://purl.org/dc/elements/1.1/"
72 <channel rdf:about="$rssurl">
73 <title>TOMBO announce</title>
75 <description>$description</description>
81 ($d, $t, $sec, $headline, $desc, $cat) = @{$i};
82 print RSS " <rdf:li rdf:resource=\"$toppage/history.html#$sec\"/>\n";
85 print RSS " </rdf:Seq>\n";
86 print RSS " </items>\n";
87 print RSS "</channel>\n";
90 ($d, $t, $sec, $headline, $desc, $cat) = @{$i};
91 print RSS "<item rdf:about=\"$toppage/history.html#$sec\">\n";
92 print RSS " <title>$headline</title>\n";
93 print RSS " <link>$toppage/history.html#$sec</link>\n";
94 print RSS " <description>\n";
96 print RSS " </description>\n";
97 print RSS " <dc:date>$d"."T$t:00+09:00</dc:date>\n";
98 print RSS " <dc:subject>$cat</dc:subject>\n";
99 print RSS "</item>\n";
102 print RSS "</rdf:RDF>\n";