2 # CGI script to get irc logs from scoop. Powers https://logs.armaanb.net.
4 channel=$(echo "$PATH_INFO" | awk -F / '{print $2}')
5 if [ -z "$channel" ]; then
6 echo "Content-type: text/plain
14 $(awk '{print " * " $0}' /etc/scoop-cgi/channels)
19 date is optional, and defaults to the current day
23 https://git.armaanb.net/bin/tree/scoop-cgi
24 it's in the public domain!"
28 channel=$(grep -x "$channel" /etc/scoop-cgi/channels)
29 if [ -z "$channel" ]; then
31 echo "Content-type: text/plain\n"
32 echo "404. Channel not logged."
36 time=$(echo "$PATH_INFO" | awk -F / '{print $3}' | xargs date -I -d)
37 db=$(cat /etc/scoop-cgi/database)
39 echo "Content-type: text/plain\n"
40 scoop -d "$db" -p "$channel" -D "${time:-now}" -F "%Y-%m-%d %H:%M:%S" \
41 | awk '{$1=""; print substr($0, 2, length($0) - 1)}'