View Single Post
Old 08-16-2012, 02:38 AM   #201
Found some matches.
Join Date: 06-02-12
Location: Los Altos, CA

Originally Posted by HKChad View Post
I question their skills as writing xml, but whatever, it works.
Heh. Yeah. I would have preferred JSON, but as you say: whatever. For such trivial data the format hardly matters. For my little gnuplot graphing tool I don't even use an XML parser, I just use bash. Literally, it's curl or wget of all.xml piped to this:

get_status() {
    local IFS="<>$IFS"
    while read W N V E R
        [ "/$N" = "$E" ] && eval $N=$V
This converts a line of XML like "<FOOD1_SET>1800</FOOD1_SET>" into the executable (vla eval) statement FOOD1_SET=1800.

(If you haven't played with this, no, that's not self-clean mode -- the temps are reported in units of degrees * 10, which is goofy, but whatever.)
flashflood is offline   Reply With Quote