#!/usr/bin/perl # # takes a text agenda, e.g. # http://lists.w3.org/Archives/Public/public-xsd-databinding/2006Jul/0000.html # http://lists.w3.org/Archives/Public/www-ws-desc/2006Jul/0002.html # http://lists.w3.org/Archives/Public/public-ws-semann/2006Jul/0000.html # # and generates an RDF format: # http://www.w3.org/2004/02/agenda # # which Zakim can then read as an agenda: # http://www.w3.org/2001/12/zakim-irc-bot.html#agenda # # both Zakim and I dislike query strings, so there's a .htaccess file: # # RewriteEngine on # RewriteBase /2006/07/ # RewriteRule RDFAgenda/(.*)$ agenda.pl?uri=$1 [NS,T=application/x-http-cgi] # # to support appending the agenda URI to this URI as follows: # http://whatfettle.com/2006/07/RDFAgenda/http://lists.w3.org/Archives/Public/public....0000.html # # written by Paul Downey # paul.downey@whatfettle.com # # released under the W3C software license: # http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 # # $Header$ # use LWP::Simple; use CGI; my $q = new CGI; my $uri = $q->param(-name=>'uri'); my $content = get $uri; unless ($uri && $content) { print $q->header(-type => 'text/html; charset=utf-8'); print< EOF if ($uri) { print "

failed to fetch '$uri'

" } print< Agenda URI:

source / blog / zakim

EOF exit(0); } print $q->header(-type => 'text/xml; charset=utf-8'); print < EOF foreach my $line (split(/\n/, $content)) { if ($line =~ /^(agenda\+|[0-9]+\.)\s+/) { $line =~ s/^(agenda\+|[0-9]+\.)\s+//; $line =~ s/\[[0-9]*\]//g; $line =~ s/\s*$//; $line =~ s/\s*:$//; print "
  • $line
  • \n"; } } print <
    EOF exit (0);