| 1 |
|
|---|
| 2 |
use Date::Manip; |
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
chdir( "/usr/home/hirokai/feedmelinks.com/misc" ); |
|---|
| 6 |
|
|---|
| 7 |
$file = "ChangeLog.inc.php"; |
|---|
| 8 |
if (open (IN, "<$file")) { |
|---|
| 9 |
$dcdate = &UnixDate(scalar localtime(),"%Y-%m-%dT%T-05:00"); |
|---|
| 10 |
|
|---|
| 11 |
my $header = '<?xml version="1.0" encoding="iso-8859-1"?> |
|---|
| 12 |
<rss version="2.0" |
|---|
| 13 |
xmlns:dc="http://purl.org/dc/elements/1.1/" |
|---|
| 14 |
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" |
|---|
| 15 |
xmlns:admin="http://webns.net/mvcb/" |
|---|
| 16 |
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" |
|---|
| 17 |
xmlns:content="http://purl.org/rss/1.0/modules/content/"> |
|---|
| 18 |
<channel> |
|---|
| 19 |
<title>Feed Me Changes!</title> |
|---|
| 20 |
<link>http://feedmelinks.com/misc/ChangeLog</link> |
|---|
| 21 |
<description>New Features and Bugfixes to Feed Me Links</description> |
|---|
| 22 |
<dc:language>en-us</dc:language> |
|---|
| 23 |
<dc:creator>jm3@feedmelinks.com</dc:creator> |
|---|
| 24 |
<dc:rights>Copyleft 2004</dc:rights> |
|---|
| 25 |
<dc:date>' . $dcdate . '</dc:date> |
|---|
| 26 |
<admin:errorReportsTo rdf:resource="mailto:jm3@feedmelinks.com"/> |
|---|
| 27 |
'; |
|---|
| 28 |
|
|---|
| 29 |
my $footer = " |
|---|
| 30 |
</channel> |
|---|
| 31 |
</rss> |
|---|
| 32 |
"; |
|---|
| 33 |
|
|---|
| 34 |
my $startItem = " |
|---|
| 35 |
<item> |
|---|
| 36 |
<title>__TITLE__</title> |
|---|
| 37 |
<link>http://feedmelinks.com/misc/ChangeLog#__ANCHOR__</link> |
|---|
| 38 |
<description>__DESC__</description> |
|---|
| 39 |
<guid isPermaLink=\"true\">http://feedmelinks.com/misc/ChangeLog#__ANCHOR__</guid> |
|---|
| 40 |
<content:encoded><![CDATA[ |
|---|
| 41 |
"; |
|---|
| 42 |
|
|---|
| 43 |
my $endItem = " |
|---|
| 44 |
]]></content:encoded> |
|---|
| 45 |
<dc:subject>__SUBJECT__</dc:subject> |
|---|
| 46 |
<dc:date>__DATE__</dc:date> |
|---|
| 47 |
</item> |
|---|
| 48 |
"; |
|---|
| 49 |
|
|---|
| 50 |
|
|---|
| 51 |
|
|---|
| 52 |
|
|---|
| 53 |
print $header; |
|---|
| 54 |
while ( <IN> ) { |
|---|
| 55 |
if( m/name="/ ) { |
|---|
| 56 |
$anchor = $line = $_; |
|---|
| 57 |
|
|---|
| 58 |
|
|---|
| 59 |
$anchor =~ s/^.*name="(\w+)".*$/$1/; |
|---|
| 60 |
|
|---|
| 61 |
$line =~ s/^.*name="\w+">//; |
|---|
| 62 |
$line =~ s:</a></b>::; |
|---|
| 63 |
|
|---|
| 64 |
$date = $line; |
|---|
| 65 |
$dcdate = ParseDate($date); |
|---|
| 66 |
$dcdate = &UnixDate($dcdate,"%Y-%m-%dT%T-05:00"); |
|---|
| 67 |
|
|---|
| 68 |
$title = "Changes of: $line"; |
|---|
| 69 |
chomp ($title); |
|---|
| 70 |
chomp ($anchor); |
|---|
| 71 |
|
|---|
| 72 |
my $si = $startItem; |
|---|
| 73 |
my $ei = $endItem; |
|---|
| 74 |
|
|---|
| 75 |
$si =~ s/__TITLE__/$title/; |
|---|
| 76 |
$si =~ s/__DESC__/$title/; |
|---|
| 77 |
$si =~ s/__ANCHOR__/$anchor/g; |
|---|
| 78 |
$ei =~ s/__SUBJECT__/Bugfixes and New Features/; |
|---|
| 79 |
$ei =~ s/__DATE__/$dcdate/; |
|---|
| 80 |
|
|---|
| 81 |
if( $count != 1 ) { |
|---|
| 82 |
print $ei; |
|---|
| 83 |
} |
|---|
| 84 |
print $si; |
|---|
| 85 |
|
|---|
| 86 |
|
|---|
| 87 |
$lineCount = 0; |
|---|
| 88 |
} else { |
|---|
| 89 |
if( ! m/^$/ ) { |
|---|
| 90 |
$line = $_; |
|---|
| 91 |
chomp( $line ); |
|---|
| 92 |
if( !m/^\s+/ ) { |
|---|
| 93 |
$line = "<br /><li>$line</li>"; |
|---|
| 94 |
} else { |
|---|
| 95 |
$line = " $line"; |
|---|
| 96 |
} |
|---|
| 97 |
print "$line<br />\n"; |
|---|
| 98 |
++$lineCount; |
|---|
| 99 |
} |
|---|
| 100 |
} |
|---|
| 101 |
++$count; |
|---|
| 102 |
} |
|---|
| 103 |
|
|---|
| 104 |
my $ei = $endItem; |
|---|
| 105 |
$ei =~ s/__SUBJECT__/Bugfixes and New Features/; |
|---|
| 106 |
$ei =~ s/__DATE__/$dcdate/; |
|---|
| 107 |
print $ei; |
|---|
| 108 |
|
|---|
| 109 |
print $footer; |
|---|
| 110 |
close (IN); |
|---|
| 111 |
} else { |
|---|
| 112 |
print "open CL FAILED\n"; |
|---|
| 113 |
} |
|---|