[FFmpeg-devel] [PATCH] Include content of the news article in the website RSS
Gerion Entrup
gerion.entrup at t-online.de
Sun May 11 01:37:02 CEST 2014
Am Donnerstag 01 Mai 2014, 23:48:29 schrieb Alexander Strasser:
> 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.
(As said offline already) My reader works with it. It would be nice to set the
pubtime as well (an example: <pubDate>Wed, 07 May 2014 18:28:18
CEST</pubDate>).
This command should work more less to build the date:
date '+%a, %d %b %Y %T %Z' -d parsed_date
(similar to date '+%c' btw) you have to keep in mind the locale, too.
See here (http://cyber.law.harvard.edu/rss/rss.html#optionalChannelElements)
for the spec.
Gerion
> 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>' >> $@
> >
>
More information about the ffmpeg-devel
mailing list