Extracting affect (or sentiment) from electronic text is a hard problem, and it’s difficult to persuade people just how hard it is. The Manhattan Times has an article that explains just how difficult it is, and has lots of useful links to projects and resources. The stand-out link is to Lillian Lee’s paper “Opinion mining and sentiment analysis“.
The first project I became aware of that tackled emotion online was We Feel Fine, which uses blogs as its source. More recent systems tend to use Twitter, such as http://twittermood.org/ which has useful links to the essays “Measuring the Happiness of Large-Scale Written Expression” and “Detecting Sadness in 140 Characters” in its references.
And it’s an older book now but Rosalind Picard’s “Affective Computing” is still a useful resource, particularly for its study of emotional taxonomies.