Another semi-useful script in my journal :-)

All you need is bash, curl and rtmpdump.
You need to have latest git version of rtmpdump because older ones don't allow --jtv option and there is no other way to send authentication token.

The attached script sends stream to stdout so you can pipe it to any media player. (in most cases adding '-' will make them read from stdin). Also notice that proper channel name can be found in channel's url. Name displayed on the webpage can be different.

Examples:
./twitch.sh zronvc | mplayer -
./twitch.sh zronvc | vlc -

I've also found a windows script but I didn't test it. You may need to update flash player url if it doesn't work.
download

EDIT: There are few great alternatives for windows and linux in comments so check them out!