Can I get the CPU temperature and fan speed from the command line in OS X? Is there a command I can run from the command line in OS X to get the current CPU temperature and/or the fan speed(s)?

To be more specific, I'd like to be able to get the same info available in the iStat widget under the Fans and Temps tabs on the command line. 

I'd like to be able to find these values at the command line so it could be scripted and plugged into a monitoring setup on my Mac - I have a data-nerd desire to collect and graph these values (and other stats) on my Macbook over time.

On Linux, it seems like this would be possible by reading a pseudo-file under the /proc directory, but I'm not sure how to do the equivalent on OS X (if it exists).
The iStats ruby gem lets you see the CPU temperature via the command-line.
Installation
$ gem install iStats
Usage
$ istats all