03/01/15 02:35
忘れた頃に。(w
--- 7search.cgi
use CGI':all';put header,start_html('7search'),startform(0,$_=script_name),p(
textfield(S),submit),endform,hr;if($s=param S){m|/[^/]+$|;$c=$`;opendir D,".";
for(sort grep/^\w+$/&-f,readdir D){if(open F,$t=$_){eval{flock F,2};/\Q$s\E/io
&&push(@r,li(a({href,"$c/7wiki.cgi/$t"},$t)," $_"))&&next while<F>;}}@r&&put ul
@r}put end_html
--- 7rss.cgi
use CGI qw/:all channel item textinput link name/;opendir D,".";$w='7wiki';url
=~m|[^/]+$|;$p=$`;put header('text/xml'),join"\n",'<?xml version="1.0"?>',
'<rdf:RDF xmlns:rdf="URLリンク(www.w3c.org)" xmlns="http'
.'://my.netscape.com/rdf/simple/0.9/">',channel(title($w),link"$p$w.cgi"),(map{
item title($_),link"$p$w.cgi/$_"}sort{-M$a<=>-M$b}grep/^\w+$/&-f,readdir D)[0..
14],textinput(title($w),link($p.'7search.cgi'),name S),'</rdf:RDF>'
つー事で載せときました。