You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
misc/shell_scripts/logs_anchors_generation

10 lines
574 B

#! /usr/bin/env bash
# TODO
# escape HTML characters
# slice by month as very long logs are problematic
# generalize for non supybot log
LOG_SOURCE=/home/utopiah/web/thelab/stigmergylive/logs/ChannelLogger/freenode/##pim/##pim.log
HTML_DEST=/home/utopiah/web/thelab/stigmergylive/logs/ChannelLogger/freenode/##pim/anchoredlog.html
echo "<html>" > $HTML_DEST && cat $LOG_SOURCE | sed "s/</[/" | sed "s/>/]/" | sed "s/\(.*\) \([*[].*\)/<a name=\"\1\"><\/a><a href=\"\/at\/\1\">\1<\/a> \2/" | sed "s/^/<p>/" | sed "s/$/<\/p>/" >> $HTML_DEST && echo "</html>" >> $HTML_DEST