| Sun | Mon | Tue | Wed | Thu | Fri | Sat |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | ||||
| 4 | 5 | 6 | 7 | 8 | 9 | 10 |
| 11 | 12 | 13 | 14 | 15 | 16 | 17 |
| 18 | 19 | 20 | 21 | 22 | 23 | 24 |
| 25 | 26 | 27 | 28 | 29 | 30 | 31 |
| Months | ||
|---|---|---|
| Jan | Feb | Mar |
| Apr | May | Jun |
| Jul | Aug | Sep |
| Oct | Nov | Dec |
[10:04] Modblog Transplant
OK, I finally moved all of the ModBlog articles over here. If anyone were to care, they could look here: blog.kynan.org/modblog. The code I used to turn the output from ModBlog into something that can be read by blosxom is a dodgy Korn shell script. I should have done it with something else but shell scripting, despite being ugly, is just too easy. I suspect this could have been done in a much nicer fashion using perl but what the hey - it worked.
#!/usr/bin/ksh
INFILE="kynan_modblog.txt"
cat $INFILE | while read -r aline
do
DATE=`echo $aline|cut -c1-4`
if [ "$DATE" == "Date" ];then
DATE=`echo $aline | awk '{print $2}'`
TIME=`echo $aline | awk '{print $4}'|sed 's/
//'`
AMPM=`echo $TIME | tr -d '[0-9:]'`
if [ $AMPM == "PM" ];then
HOUR=`echo $TIME | cut -f1 -d:`
HOUR=$(($HOUR + 12))
if [ $HOUR -eq 24 ];then
HOUR=00
fi
else
HOUR=`echo $TIME | cut -f1 -d:`
if [ ${#HOUR} -eq 1 ];then
HOUR=0$HOUR
fi
fi
TIME=$HOUR`echo $TIME|cut -f2 -d:|tr -d '[A-Z]'`
YEAR=`echo $DATE | cut -d/ -f3`
MONTH=`echo $DATE | cut -d/ -f1`
DAY=`echo $DATE | cut -d/ -f2`
if [ ${#MONTH} -eq 1 ];then
MONTH=0$MONTH
fi
if [ ${#DAY} -eq 1 ];then
DAY=0$DAY
fi
OUTFILE=$YEAR$MONTH$DAY-$TIME
fi
if [ "----------
" == "$aline" ];then
mv $$ ./done/${OUTFILE}.txt
echo touch -t $MONTH$DAY$TIME ./done/${OUTFILE}.txt
else
echo -E "$aline" >> $$
fi
done
[02:58] White Christmas...check!
It was a mite nippy when I stepped out to go to work this morning and by the time I hit London Bridge it was snowing, albeit in a somewhat off-handed and desultory manner. I called Shona when I got to work and she had apparently been trying to call me. IT all sort off packed up by 0930 but then, about 30 minutes later it put on a show of force and really dumped. I don't know what it's like at the moment as my office has no windows but Firefox (well ForecastFox actually) tells me that it is now up to 0 degrees from -2 and it's also "Partly Sunny" as opposed to "Snowing" so I guess the shows over. Now I just have a slushy ride home to look forward to!