#!/bin/sh header() { local kind="$2" cat <<-EOT
EOT if [ "$kind" = "individual" ]; then cat <<-EOT
EOT fi cat <<-EOT
EOT } footer() { cat <<-EOT
EOT } ext=${1##*/} log=${ext%.*} ext=${ext#$log} [ ! "$ext" ] && ext=".html" if [ "$log" = "index" ]; then header "Index" "index" echo "

T2 IRC logs

" for year in `(cd $PWD/irclogs/raw; ls t2-????-??-?? | cut -d - -f 2 | sort -u -r)` do cat <<-EOT
EOT echo "

$yearStatistics)

" for month in `(cd $PWD/irclogs/raw/; ls t2-$year-??-?? | cut -d - -f 3 | sort -u -r)` do case $month in 01) m="January" ;; 02) m="February" ;; 03) m="March" ;; 04) m="April" ;; 05) m="May" ;; 06) m="June" ;; 07) m="July" ;; 08) m="August" ;; 09) m="September" ;; 10) m="October" ;; 11) m="November" ;; 12) m="December" ;; esac echo "

$m

" echo "" x=1 echo "" (cd $PWD/irclogs/raw/; ls -la --si t2-$year-$month-?? | tr -s ' ' | cut -d ' ' -f 5,9) | while read size day do day=${day##*-} echo -n "" if [ $(( x++ % 7 )) = 0 ] ; then echo "" fi done echo "" echo "
$day ($size)
" echo -n "[html]" echo -n "[raw]
" done done footer else file="$PWD/irclogs/raw/$log" if [ ! -e "$file" ]; then echo "404" exit 1 fi if [ "$ext" != ".txt" ]; then date="${log#t2-}" date="${date//[^[0-9]-]/_}" # secure next="`date --date="$date -1 day" +"%Y-%m-%d"`" prev="`date --date="$date +1 day" +"%Y-%m-%d"`" header "$date" "individual" cat <<-EOT

T2 IRC Log: $date

This is the log as captured by an IRC bot in the channel. The statements are those of the individual people and might not neccessarily reflect the policy and legal rules as set forth by the T2 SDE Project.

EOT cat <<-EOT

« prev | next »

EOT echo "
" sed -e 's,\(https\?://[^ ,]*\),\1,g' \ -e 's,$,
,' $file echo "
" footer else cat $file fi fi