|
|
|
@ -1,7 +1,7 @@ |
|
|
|
|
#!/usr/bin/perl |
|
|
|
|
use strict; |
|
|
|
|
use warnings; |
|
|
|
|
use Time::localtime; |
|
|
|
|
use POSIX qw(strftime); |
|
|
|
|
|
|
|
|
|
open(my $fh, ">>$ARGV[0].rss") or die "File:$!"; |
|
|
|
|
|
|
|
|
@ -10,13 +10,8 @@ print $fh "<rss version=\"2.0\" xmlns:atom=\"http://www.w3.org/2005/Atom\">\n"; |
|
|
|
|
print $fh "\t<channel>\n"; |
|
|
|
|
print $fh "\t\t<title>$ARGV[0]</title>\n"; |
|
|
|
|
print $fh "\t\t<description>$ARGV[1]</description>\n"; |
|
|
|
|
print $fh "\t\t<link>$ARGV[2]<link>\n"; |
|
|
|
|
print $fh "\t\t<atom:link href=\"$ARGV[2]/$ARGV[0].rss\" rel=\"self\" type=\"application/rss+xml\" />\n"; |
|
|
|
|
my $monthday = localtime->mday(); |
|
|
|
|
my $month = localtime->mon() + 1; |
|
|
|
|
my $year = localtime->year() + 1900; |
|
|
|
|
my $hour = localtime->hour(); |
|
|
|
|
my $min = localtime->min(); |
|
|
|
|
my $sec = localtime->sec(); |
|
|
|
|
print $fh "\t\t<pubDate>$monthday $month $year $hour:$min:$sec </pubDate>\n"; |
|
|
|
|
print $fh "\t\t<lastBuildDate>$monthday $month $year $hour:$min:$sec </lastBuildDate>\n"; |
|
|
|
|
print $fh "\t\t<link>http://$ARGV[2]</link>\n"; |
|
|
|
|
print $fh "\t\t<atom:link href=\"http://$ARGV[2]/$ARGV[0].rss\" rel=\"self\" type=\"application/rss+xml\" />\n"; |
|
|
|
|
my $todaydate = strftime("%a, %d %b %Y %H:%M:%S %z", localtime(time())); |
|
|
|
|
print $fh "\t\t<pubDate>$todaydate</pubDate>\n"; |
|
|
|
|
print $fh "\t\t<lastBuildDate>$todaydate</lastBuildDate>\n"; |
|
|
|
|