#!/bin/perl use CGI; print "Content-type: text/html\n\n"; my $cgi = new CGI; $cgi->import_names("FORM"); my $title = $FORM::title; my $url = $FORM::url; my $nick = $FORM::nick; my $blurb = $FORM::blurb; my $topic = $FORM::topic; $title=~ s/&/amp;/; $url=~ s/&/amp;/; $nick=~ s/&/amp;/; $blurb=~ s/&/amp;/; $topic=~ s/&/amp;/; print " RDF Calendar taskforce

RDF Calendar taskforce chump

Links

"; print "

your name:

url:

title:

comment:


"; if($url eq ""){ print "

Please add a URL

"; }else{ if($topic eq ""){ $topic="unclassified"; } if($nick eq ""){ $nick="nobody"; } if($title eq ""){ $title=$url; } my $date=`date -I`; my $time=`date`; my $newtopic; $time=~ s/.*\s(\d\d:\d\d:\d\d)\s.*/$1/g; my $infilen="/usr/local/httpd/apache/htdocs/calendar/links/index.xml"; my $outfilen="/usr/local/httpd/apache/htdocs/calendar/links/tmp.xml"; my $bkn="/usr/local/httpd/apache/htdocs/calendar/links/links.bk"; open (IN,"$infilen") or die "oops"; open (OUT,">$outfilen"); open (BK,">>$bkn"); my $firsttest=""; my $testy=`grep "$firsttest" $infilen`; if($testy ne ""){ # print "...ok"; }else{ $newtopic=$topic; $topic="xxx"; # print ".NOT..ok"; } my $test=""; while(){ if(/$test/){ #print "\ngot it!\n"; print OUT " \n"; if($newtopic ne ""){ print OUT "\n$newtopic\n"; } print OUT "\n $url $nick $title "; if($newtopic ne ""){ print OUT "$newtopic"; } if($topic ne ""){ print OUT "$topic"; } if($blurb ne ""){ print OUT "$blurb\n"; } print OUT "\n"; # } }else { print OUT $_; } print BK $_; }#end while close(IN); close(OUT); print `mv /usr/local/httpd/apache/htdocs/calendar/links/tmp.xml /usr/local/httpd/apache/htdocs/calendar/links/index.xml`; print `./2html`; print `./2rss`; print ("

Successfully added link

"); }#end else print "";