For reference, this post is originally linked to http://www.readwriteweb.com/hack/2011/03/text-extraction.php