Comments on I am now an RDF property

jko (2003-09-07T00:40:36Z)

merci ;-) mais bon, si je suis le seul a l'utiliser c'est peu etre pas trop important .. enfin ca dépend si la poule est antécédente à l'oeuf ou non, et cela nous amenerais à des considérations d'autoinférence bien trop subtiles par rapport a l'interret de ce rss !
.. hmm oula c'est fou ce qu'on peu dire n'importe quoi à une heure pareille

Ruxor (2003-09-07T00:08:25Z)

C'est gentil, jko ; je crois que ce sera plus simple pour moi d'extraire directement le RSS de la base de données par un cgi-bin plutôt que de filtrer le lscomments qui en est extrait. Je programmerai ça quand j'aurai un moment.

jko (2003-09-06T20:27:05Z)

Pour avoir un petit rss des comments je propose:

cat > mk_rss_comments_head
<?xml version="1.0" encoding="utf-8"?><!--*- coding: utf-8 -*-->
<rdf:RDF xml:lang="en" xmlns:xml="http://www.w3.org/XML/1998/namespace" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/">
<channel rdf:about="http://www.eleves.ens.fr:8080/home/madore/weblog/">
<title>David Madore's WebLog comments</title>
<link>http://www.eleves.ens.fr:8080/home/madore/weblog/</link>
<description>David Madore's WebLog comments</description>
<sy:updatePeriod>hourly</sy:updatePeriod>
<sy:updateFrequency>3</sy:updateFrequency>
<sy:updateBase>2003-05-01T10:00:00Z</sy:updateBase>
<items>
<rdf:Seq>
^d

puis mettre dans un script bash :
#!/bin/sh
#
# ./mkrss out
#

cat mk_rss_comments_head > $1

wget "http://dmadore.net1.nerim.net/cgi-bin/comment.pl/lscomments" -O raw

IFS=$'\n'
for a in `egrep '<li>' raw | head -10 | sed -e 's,<li><a href=,,g' -e 's,>Comment..*,,g'` ; do echo "<rdf:li rdf:resource=$a />" >> $1; done

echo "</rdf:Seq>
</items>
</channel>" >> $1

for a in `egrep '<li>' raw | head -10 | sed -e 's,<li><a href=,,g' -e 's,>Comment..*..html#d.,>,g' -e 's,</a> ,,' -e 's,</li>,,' -e 's,<a href..*..">,,' -e 's,</a>,,'` ; do b=`echo $a | sed -e 's,",,g' -e 's,>..*,,'`; c="\"$b\""; d=`echo $a | sed -e 's,..*</code>by ,,'`; echo "
<item xml:lang=\"fr\" rdf:about=$c>
<title>$d</title>
<link>$b</link>
</item>" >> $1; done

echo "</rdf:RDF>" >> $1

(c'est tres mal fait et tres moche je sais.. sond si quelqu'un veut s'ammuser à l'ameliorer, pkoi pas .. j'ai un peu la flemme)


You can post a comment using the following fields:
Name or nick (mandatory):
Web site URL (optional):
Email address (optional, will not appear):
Identifier phrase (optional, see below):
Attempt to remember the values above?
The comment itself (mandatory):

Optional message for moderator (hidden to others):

Spam protection: please enter below the following signs in reverse order: 3d7760


Recent comments