[FFmpeg-devel] [PATCH 5/5] web/rss: Write tag item/pubDate

Alexander Strasser eclipse7 at gmx.net
Fri May 23 00:18:50 CEST 2014


Signed-off-by: Alexander Strasser <eclipse7 at gmx.net>
---
 gen-rss | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/gen-rss b/gen-rss
index c686c58..6894147 100755
--- a/gen-rss
+++ b/gen-rss
@@ -2,6 +2,7 @@
 
 use strict;
 use warnings;
+use Time::Piece;
 
 print '<?xml version="1.0" encoding="UTF-8" ?>
 <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
@@ -18,10 +19,13 @@ while (<>) {
   if (m{<a *id="(.*)" *> *</a> *<h3>(.*20..), *(.*)</h3>}) {
     $do_print = 1;
     my ($id, $date, $title) = ($1, $2, $3);
+    my $time = Time::Piece->strptime($date, "%B %d, %Y");
+    my $tag_pubDate = $time->strftime("\n        <pubDate>%a, %d %b %Y %H:%M:%S +0000</pubDate>");
+
     $_ = "$closing_tags    <item>
         <title>$date, $title</title>
         <link>http://ffmpeg.org/index.html#$id</link>
-        <guid>http://ffmpeg.org/index.html#$id</guid>
+        <guid>http://ffmpeg.org/index.html#$id</guid>$tag_pubDate
         <description>$title</description>
         <content:encoded><![CDATA[
 ";
-- 


More information about the ffmpeg-devel mailing list