#!/bin/sh

# Extracts data as date,temp CSV to stdout from the HTML page source:
#     .note-on-data-for-16WW-mains-water-inlet-temperature.html
#
# Input rows of form:
#    <tr><td> 14&deg;C </td><td> 2008-11-19 08:36 UTC </td><td class="dopt"></td></tr>
# Output CSV with lines of form (note date now first, and without time):
#    2008-11-19,14

SRC=.note-on-data-for-16WW-mains-water-inlet-temperature.html

sed <$SRC -n -e 's/^<tr><td> *\([0-9]*\).deg;C *<\/td><td><time> *\(20[0-9][0-9]-[01][0-9]-[0-3][0-9]\) *.*$/\2,\1/gp'
