Package: www.debian.org
Severity: wishlist

There should be an RSS feed for DWN.  The attached mail contains a
script that could be used as a starting point.

-- 
Matt
From [EMAIL PROTECTED] Sat Feb 12 12:50:56 2005
Return-path: <[EMAIL PROTECTED]>
Envelope-to: [EMAIL PROTECTED]
Delivery-date: Sat, 12 Feb 2005 12:50:56 -0800
Received: from localhost ([127.0.0.1] ident=kraai)
        by localhost.localdomain with esmtp (Exim 4.34)
        id 1D04E9-0000v9-2d
        for [EMAIL PROTECTED]; Sat, 12 Feb 2005 12:50:56 -0800
Received: from zoon.lafn.org [206.117.18.9]
        by localhost with POP3 (fetchmail-6.2.5)
        for [EMAIL PROTECTED] (single-drop); Sat, 12 Feb 2005 12:50:53 -0800 
(PST)
Received: from master.debian.org (master.debian.org [146.82.138.7])
        by zoon.lafn.org (8.12.3p3/8.11.3) with ESMTP id j1BH7Cxd028736
        for <[EMAIL PROTECTED]>; Fri, 11 Feb 2005 09:07:12 -0800 (PST)
        (envelope-from [EMAIL PROTECTED])
Received: from luonnotar.infodrom.org [195.124.48.78] 
        by master.debian.org with esmtp (Exim 3.35 1 (Debian))
        id 1CzeG7-00073q-00; Fri, 11 Feb 2005 11:07:11 -0600
Received: by luonnotar.infodrom.org (Postfix, from userid 10)
        id 84442366B73; Fri, 11 Feb 2005 18:07:16 +0100 (CET)
Received: at Infodrom Oldenburg (/\##/\ Smail-3.2.0.102 1998-Aug-2 #2)
        from infodrom.org by finlandia.Infodrom.North.DE
        via smail from stdin
        id <[EMAIL PROTECTED]>
        for [EMAIL PROTECTED]; Fri, 11 Feb 2005 18:01:14 +0100 (CET) 
Date: Fri, 11 Feb 2005 18:01:13 +0100
From: Martin Schulze <[EMAIL PROTECTED]>
To: Matt Kraai <[EMAIL PROTECTED]>
Cc: Filippo Giunchedi <[EMAIL PROTECTED]>
Message-ID: <[EMAIL PROTECTED]>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="4N42/ivucor2EeDs"
Content-Disposition: inline
User-Agent: Mutt/1.5.6+20040907i
X-Virus-Scanned: ClamAV 0.80/629/Tue Dec 14 11:01:57 2004
        clamav-milter version 0.80j
        on zoon.lafn.org
X-Virus-Status: Clean
X-UIDL: Gi8"!OfG"!'\U!!pKa!!
X-SA-Exim-Connect-IP: 127.0.0.1
X-SA-Exim-Mail-From: [EMAIL PROTECTED]
Subject: [EMAIL PROTECTED]: Re: RSS feed for DWN]
X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on catalunya
X-Spam-Level: 
X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham 
        version=3.0.2
X-SA-Exim-Version: 4.2 (built Tue, 25 Jan 2005 19:51:04 +0000)
X-SA-Exim-Scanned: Yes (on localhost.localdomain)
Status: RO
Content-Length: 8435
Lines: 267


--4N42/ivucor2EeDs
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline

Hi Matt,

here's an addition to get DWN converted into an RSS feed as well.
Maybe you want to adopt it to the web pages.  It would have to
be modified to use local .html or .wml files instead of wget
but that should be easy.  I haven't testet it yet.

Regards,

        Joey

-- 
The good thing about standards is that there are so many to choose from.
                -- Andrew S. Tanenbaum

--4N42/ivucor2EeDs
Content-Type: message/rfc822
Content-Disposition: inline

Return-Path: <[EMAIL PROTECTED]>
X-Original-To: [EMAIL PROTECTED]
Delivered-To: [EMAIL PROTECTED]
Received: by finlandia.infodrom.north.de (Postfix, from userid 10)
        id 8BE1EFDD5; Fri, 11 Feb 2005 17:57:12 +0100 (CET)
Received: from luonnotar (localhost [127.0.0.1])
        by finlandia.infodrom.north.de (Postfix) with SMTP id 007FBDDD5C
        for <[EMAIL PROTECTED]>; Fri, 11 Feb 2005 17:57:11 +0100 (CET)
X-Mailbox-Line: From [EMAIL PROTECTED]  Fri Feb 11 17:48:33 2005
Received: by luonnotar.infodrom.org (Postfix, from userid 1001)
        id 0EBDC366B75; Fri, 11 Feb 2005 17:48:32 +0100 (CET)
X-Original-To: joey
Delivered-To: [EMAIL PROTECTED]
Received: by luonnotar.infodrom.org (Postfix, from userid 38)
        id 832DC366B65; Fri, 11 Feb 2005 17:48:29 +0100 (CET)
X-Original-To: [EMAIL PROTECTED]
Delivered-To: [EMAIL PROTECTED]
Received: from master.debian.org (master.debian.org [146.82.138.7])
        by luonnotar.infodrom.org (Postfix) with ESMTP id 0153B366B7B
        for <[EMAIL PROTECTED]>; Fri, 11 Feb 2005 17:47:46 +0100 (CET)
Received: from joey by master.debian.org with local (Exim 3.35 1 (Debian))
        id 1CzdxE-0003si-00; Fri, 11 Feb 2005 10:47:40 -0600
X-Mail-Format-Warning: Bad RFC2822 header formatting in >From joey  Fri Feb 11 
10:47:37 2005
Received: from ns0.nexlab.net (nexlab.it) [213.198.155.21] 
        by master.debian.org with smtp (Exim 3.35 1 (Debian))
        id 1CzdxA-0003rs-00; Fri, 11 Feb 2005 10:47:36 -0600
Received: (qmail 25975 invoked by uid 1219); 11 Feb 2005 16:47:35 -0000
Received: from 80.116.153.178 by danex (envelope-from <[EMAIL PROTECTED]>, uid 
1040) with qmail-scanner-1.24 
 (f-prot: 4.1.1/3.13.3. ,X-Envelope-From: [EMAIL PROTECTED]
Date: Fri, 11 Feb 2005 17:47:30 +0100
From: Filippo Giunchedi <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: Re: RSS feed for DWN
Message-ID: <[EMAIL PROTECTED]>
References: <[EMAIL PROTECTED]> <[EMAIL PROTECTED]>
Mime-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
        protocol="application/pgp-signature"; boundary="uh9ZiVrAOUUm9fzH"
Content-Disposition: inline
In-Reply-To: <[EMAIL PROTECTED]>
X-Editor: VIM - Vi IMproved 6.3
Organization: NoName Inc.
Delivered-To: [EMAIL PROTECTED]
Delivered-To: [EMAIL PROTECTED]
X-Loop: [EMAIL PROTECTED]
Sender: Martin Schulze <[EMAIL PROTECTED]>
X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on 
        luonnotar.infodrom.org
X-Spam-Level: 
X-Spam-Status: No, score=-0.9 required=5.0 tests=AWL,BAYES_00,
        FORGED_RCVD_HELO autolearn=ham version=3.0.2
X-Folder: [EMAIL PROTECTED]


--uh9ZiVrAOUUm9fzH
Content-Type: multipart/mixed; boundary="WhfpMioaduB5tiZL"
Content-Disposition: inline


--WhfpMioaduB5tiZL
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Thu, Feb 10, 2005 at 06:21:02PM +0100, Martin Schulze wrote:
> Filippo Giunchedi wrote:
> > Hi Joey,
> > first of all thanks for DWN, it is very useful to have a weekly digest =
of
> > activity in debian!
> > I didn't find an RSS feed for DWN, is there one? If no I can provide on=
e by
> > either patching webwml or with an external link.
>=20
> Please go ahead, but and submit a patch for webwml.  However, the
> editorial should not be used as text.  The summary may, or the
> paragraph headlines.

Actually I used only the text within <strong></strong>, anyway it would be =
fine
to have also a named anchor with every news so you can directly refer to as

$(HOME)/News/weekly/<year>/<issue>/#title

by using for example a function weeklytitle(title) in
wml::debian::weeklynews::index

sub weeklytitle() {
    my ($title) =3D @_;
    $anchor =3D $title;
    $anchor =3D~ s/\s//g;
    $anchor =3D~ s/\.$//;
    print "<a name=3D\"$anchor\"></a><strong>$title</strong>";
}

I also made PUBDATE available as a comment for later retrieval, patch attac=
hed.

filippo
--
Filippo Giunchedi=20
GNU/PG key: 6B79D401
Random signature follows:

I find television very educating. Every time somebody turns on the set, I go
into the other room and read a book.
-- Groucho Marx

--WhfpMioaduB5tiZL
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="dwn_fg.diff"
Content-Transfer-Encoding: quoted-printable

diff -urN -x *CVS* webwml.orig/english/News/weekly/makerss.pl webwml/englis=
h/News/weekly/makerss.pl
--- webwml.orig/english/News/weekly/makerss.pl  Thu Jan  1 01:00:00 1970
+++ webwml/english/News/weekly/makerss.pl       Fri Feb 11 17:22:30 2005
@@ -0,0 +1,91 @@
+#!/usr/bin/perl
+# Generates RSS feed for DWN, some code stolen from makemail.pl
+
+use locale;
+use POSIX qw(strftime);
+
+
+# default, if parsing the page can't find any
+$pubdate_rfc =3D strftime("%a, %d %b %Y %H:%M:%S %Z", gmtime());
+$pubdate =3D strftime("%Y-%m-%d", gmtime());
+
+# default language
+$lang =3D "en-us";
+
+my $current_issue=3D`cat CURRENT-ISSUE-IS`;
+chomp $current_issue;
+
+my $url=3Dshift || "http://www.debian.org/News/weekly/$current_issue/";;
+
+my $tmpfile;
+my $tmpdir;
+
+# Remove the multibyte stuff
+if ($url =3D~ "^http://";) {
+    open(IN, "wget -q -O - $url|") or die "Can't open $url: $!\n";
+
+    $tmpdir =3D "/tmp/dwn.$$";
+    mkdir $tmpdir || die "Can't mkdir, $!\n";
+    $tmpfile =3D "$tmpdir/dwn.html";
+} else {
+    open(IN, $url) or die "Can't open $url: $!\n";
+
+    my @foo =3D split (/\./, $url);
+    pop @foo;
+    $tmpfile =3D join (".", @foo) .".tmp.html";
+}
+
+open(OUT, ">$tmpfile") or die "Can't write to $tmpfile: $!\n";
+
+while (<IN>) {$all .=3D $_}
+
+# Remove old multibyte codes=20
+$all =3D~      s/\((&#\d{3,5};\s*)+\)//sg;
+
+print OUT $all;
+close (IN);
+close (OUT);
+
+my @stories;
+open (IN, $tmpfile) or die "Can't open $tmpfile";
+
+while (<IN>) {
+       # this fails with localized DWN
+    last if /<p><strong>Want to continue reading DWN/;
+
+    if( /<!-- (\d\d)-(\d\d)-(\d\d) -->/) {
+        # RFC-822 date
+        $pubdate_rfc =3D strftime("%a, %d %b %Y %H:%M:%S %Z", 0, 0, 0, $3,=
 $2, $1);
+        $pubdate =3D strftime("%Y-%m-%d", 0, 0, 0, $3, $2, $1);
+    }
+
+    # TODO have a named anchor in every <p> in index.wml so we can have a
+    # direct URL
+    if( /<p><strong>(.+)<\/strong>/) {
+       push @stories, $1;=20
+    }
+}
+
+print '
+<?xml version=3D"1.0" encoding=3D"ISO-8859-1"?>
+<rss version=3D"2.0" xmlns:dc=3D"http://purl.org/dc/elements/1.1/";>
+    <channel>
+        <title>Debian Weekly News</title>
+        <link>http://www.debian.org/News/weekly/</link>
+        <language>'.$lang.'</language>
+    </channel>
+';
+
+foreach $story (@stories){
+print "    <item>
+        <title>$story</title>
+        <link>http://www.debian.org/News/weekly/$current_issue/</link>
+        <dc:creator>[EMAIL PROTECTED]</dc:creator>
+        <dc:date>$pubdate</dc:date>
+    </item>
+";
+}
+print "</rss>\n";
+
+unlink ($tmpfile);
+rmdir ($tmpdir) if ($tmpdir);
diff -urN -x *CVS* webwml.orig/english/template/debian/weeklynews/header.wm=
l webwml/english/template/debian/weeklynews/header.wml
--- webwml.orig/english/template/debian/weeklynews/header.wml   Fri Feb 11 17=
:39:16 2005
+++ webwml/english/template/debian/weeklynews/header.wml        Thu Feb 10 
20:51:0=
0 2005
@@ -3,3 +3,4 @@
 #use wml::debian::ctime
 #use wml::debian::links.tags
 #use wml::debian::template title=3D"<debianweeklynews/> - <:=3D&spokendate=
('$(PUBDATE)'):>$(PAGENAME)" NOHOMELINK=3D"yes" BARETITLE=3D"yes" NOCOMMENT=
S=3D"yes" SUMMARY=3D"$(SUMMARY)"
+<!-- $(PUBDATE) -->

--WhfpMioaduB5tiZL--

--uh9ZiVrAOUUm9fzH
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (Darwin)

iD8DBQFCDOGiABzeamt51AERAqZcAJ0dV1y8hHHy1bPpvGtHeIYDbxY99ACgwqyX
mQIiSwqk6noVkql6vINVzeM=
=xY0H
-----END PGP SIGNATURE-----

--uh9ZiVrAOUUm9fzH--


--4N42/ivucor2EeDs--


Attachment: signature.asc
Description: Digital signature

Reply via email to