#!/bin/bash
# Example of this script using:
# (defun my-stmcrblog-after-add-entry-hook ()
# (shell-command (concat "stmcrblog " stmcrblog-file " /srv/www/htdocs/jobdoneblog.html"))
# )
# (add-hook 'stmcrblog-after-add-entry-hook 'my-stmcrblog-after-add-entry-hook)
# (global-set-key (kbd "C-c y") 'stmcrblog-post-current-line)
in=$1
out=$2
if [[ ! -f $in ]]; then
echo Input file not found.
exit 1
fi
if [[ -z $out ]]; then
echo I don\'t know where is output file...
exit 1
fi
{
echo '<html>'
echo '<head>'
echo ' <meta http-equiv="Content-Type" content="text/html; charset=utf-8">'
echo ' <title>Job done blog.</title>'
echo '</head>'
echo '<body>'
echo '<h1>Job done blog.</h1>'
echo '<ul>'
sed \
-e 's|^\([[:digit:]-]\+[02468]\) \([[:digit:]:]\+\) \(.*\)| <li><span style="color: green;">\1 \2</span> \3</li>|' \
-e 's|^\([[:digit:]-]\+[13579]\) \([[:digit:]:]\+\) \(.*\)| <li><span style="color: blue;">\1 \2</span> \3</li>|'
echo '</ul>'
echo '<address>'
echo ' <a href="mailto:gavenko@bifit.com.ua">Oleksandr Gavenko</a>'
echo ' </address>'
echo '</body>'
echo '</html>'
} <$in >$out