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