[FFmpeg-devel] [PATCH] Include content of the news article in the website RSS

Alexander Strasser eclipse7 at gmx.net
Thu May 1 23:48:29 CEST 2014


Hi Gerion,

  AFAICT your patch would be OK to apply. I would make some
minor adjustments about the variable naming and indentation,
but do not bother I will do it on top your work.

  Regarding the warning of the content vs description fields
as children of item, I do not think it should matter much as
we previously had neither.

  Though while I was doing some tests and some cosmetics,
I did some experimentation and came up with the attached
alternative. What do you and/or others think of it?
 
  Besides validation I couldn't yet properly test what feed
readers make of it. So please forgive me if it causes obvious
problems with your reader.

  Alexander

On 2014-04-24 02:35 +0200, Gerion Entrup wrote:
> Fixes Trac ticket #844
> ---
>  Makefile | 26 +++++++++++++++++++++-----
>  1 file changed, 21 insertions(+), 5 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index db2ac28..a22232c 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -19,19 +19,35 @@ htdocs/%.html: src/% src/%_title $(PAGE_DEPS)
>  
>  htdocs/main.rss: htdocs/index.html
>  	echo '<?xml version="1.0" encoding="UTF-8" ?>' > $@
> -	echo '<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">' >> $@
> +	echo '<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">' >> $@
>  	echo '<channel>' >> $@
>  	echo '    <title>FFmpeg RSS</title>' >> $@
>  	echo '    <link>http://ffmpeg.org</link>' >> $@
>  	echo '    <description>FFmpeg RSS</description>' >> $@
>  	echo '    <atom:link href="http://ffmpeg.org/main.rss" rel="self" type="application/rss+xml" />' >> $@
> -	grep '<a *id=".*" *></a><h3>.*20..,.*</h3>' $< | sed 'sX<a *id="\(.*\)" *> *</a> *<h3>\(.*20..\), *\(.*\)</h3>X\
> +	NSTART=''
> +	while read line; do \
> +		if echo "$$line" | grep '<h1>Older entries are in the .*news archive' -q ; then \
> +			break; \
> +		fi; \
> +		if echo "$$line" | grep '<a *id=".*" *></a><h3>.*20..,.*</h3>' -q ; then \
> +			if [ $$NSTART ]; then \
> +				echo "        ]]></content:encoded>" >> $@; \
> +				echo "    </item>" >> $@ ; echo >> $@; \
> +			fi; \
> +			echo "$$line" | sed 'sX<a *id="\(.*\)" *> *</a> *<h3>\(.*20..\), *\(.*\)</h3>X\
>      <item>\
>          <title>\2, \3</title>\
>          <link>http://ffmpeg.org/index.html#\1</link>\
> -        <guid>http://ffmpeg.org/index.html#\1</guid>\
> -    </item>\
> -X' >> $@
> +        <guid>http://ffmpeg.org/index.html#\1</guid>X' >> $@; \
> +		echo -n '        <content:encoded><![CDATA[' >> $@; \
> +		NSTART='yes'; \
> +		elif [ $$NSTART -a "$$line" ]; then \
> +			echo "        $$line" >> $@; \
> +		fi; \
> +	done < $<
> +	echo '        ]]></content:encoded>' >> $@
> +	echo '    </item>' >> $@
>  	echo '</channel>' >> $@
>  	echo '</rss>' >> $@
>  
> -- 
> 1.8.4.5
-------------- next part --------------
From f4ef4a283db2f068b5fe63d4d6717cf55337f215 Mon Sep 17 00:00:00 2001
Message-Id: <f4ef4a283db2f068b5fe63d4d6717cf55337f215.1398976782.git.eclipse7 at gmx.net>
From: Alexander Strasser <eclipse7 at gmx.net>
Date: Thu, 1 May 2014 22:34:46 +0200
Subject: [PATCH] web/rss: Include content of the news article

Fixes Trac ticket #844

Signed-off-by: Alexander Strasser <eclipse7 at gmx.net>
---
 Makefile | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
index db2ac28..2f6c16f 100644
--- a/Makefile
+++ b/Makefile
@@ -19,19 +19,24 @@ htdocs/%.html: src/% src/%_title $(PAGE_DEPS)
 
 htdocs/main.rss: htdocs/index.html
 	echo '<?xml version="1.0" encoding="UTF-8" ?>' > $@
-	echo '<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">' >> $@
+	echo '<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">' >> $@
 	echo '<channel>' >> $@
 	echo '    <title>FFmpeg RSS</title>' >> $@
 	echo '    <link>http://ffmpeg.org</link>' >> $@
 	echo '    <description>FFmpeg RSS</description>' >> $@
 	echo '    <atom:link href="http://ffmpeg.org/main.rss" rel="self" type="application/rss+xml" />' >> $@
-	grep '<a *id=".*" *></a><h3>.*20..,.*</h3>' $< | sed 'sX<a *id="\(.*\)" *> *</a> *<h3>\(.*20..\), *\(.*\)</h3>X\
+	awk '/<a *id=".*" *> *<\/a> *<h3>.*20.., *.*<\/h3>/ { p = 1 } /<h1>Older entries are in the .*news archive/ { p = 0 } p' $< \
+        | sed 'sX<a *id="\(.*\)" *> *</a> *<h3>\(.*20..\), *\(.*\)</h3>X\
+        ]]></content:encoded>\
+    </item>\
     <item>\
         <title>\2, \3</title>\
         <link>http://ffmpeg.org/index.html#\1</link>\
         <guid>http://ffmpeg.org/index.html#\1</guid>\
-    </item>\
-X' >> $@
+        <content:encoded><![CDATA[X' \
+	| awk 'NR > 3' >> $@
+	echo '        ]]></content:encoded>' >> $@
+	echo '    </item>' >> $@
 	echo '</channel>' >> $@
 	echo '</rss>' >> $@
 
-- 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140501/f90fa42d/attachment.asc>


More information about the ffmpeg-devel mailing list