California wine country may be the happiest place in the United States, at least if its Twitter feed is any indication.

An analysis of the sentiments in 10 million location-tagged tweets has revealed that Napa, Calif., is the happiest U.S. city, while Hawaii is the happiest state. Beaumont, Texas, is the least happy, according to the findings published Tuesday (Feb. 19) in the preprint journal arXiv.org.

Many different organizations track happiness. The United Nations published a World Happiness Report ranking countries by well-being, while Gallup and Healthways collect polling data from the United States. But those surveys aren't measuring what people say in real-time instead relying on survey questions.

To see how tweets could reveal city-level happiness, University of Vermont mathematician Lewis Mitchell and his colleagues created a tool called the "hedonmeter." The hedonmeter collected 10 million tweets that had location data attached from 373 urban areas in the United States — nearly 10 percent of all of Twitter's 2011 posts with location data. They then broke them into individual words.

To figure out which words were happy, sad or neutral, the team used ratings that came from 10,000 users of a website called Mechanical Turk, who assessed 5,000 common words. Curse words and words like "hate" or "wrong" tended to be rated as sad words, while words such as "lol," "sleep" and "funny" were rated as happy.

In general, the Bible Belt and the industrial Rust Belt, which straddles the Midwest and Northeast, rated as less happy than cities in the Western part of the country. Beaumont, Tex., an industrial city in the Gulf, rated as the least happy city, while Louisiana was the least happy state.

Byers Market Newsletter Get breaking news and insider analysis on the rapidly changing world of media and technology right to your inbox. This site is protected by recaptcha

Not surprisingly, happiness correlated with income level in different geographic areas. In addition, happiness seemed to be inversely correlated with obesity rates in that area, but this could be due to chronic health problems that are more prevalent in obese people, the authors note.

The 10 happiest cities were:

Napa, Calif. Longmont, Colo. San Clemente, Calif. Santa Fe, N.M. Santa Cruz, Calif. Green Bay, Wis. Santa Rosa, Calif. Simi Valley, Calif. Lafayette, Colo. Asheville, N.C.

The 10 least happy cities:

Beaumont, Texas Albany, Ga. Texas City, Texas Shreveport, La. Monroe, La. Memphis, Tenn. Battle Creek, Mich. Flint, Mich. Lima, Ohio Houma, La.

(See List of happiest and saddest U.S. cities and states )

Of course, there are limitations to the methodology, like having a skewed sample of the population.

"Only 15 percent of online adults regularly use Twitter, and 18-29 year olds and minorities tend to be more highly represented on Twitter than in the general population," the authors write in the paper.

And as Alexis Madrigal notes at The Atlantic, it's possible these differences reflect regional or cultural differences in how people express their happiness, not underlying positive feelings.

Past research has found a variety of factors linked with happiness, including education levels, economic indicators and personality traits. For instance, a study published in 2009 found the happiest states tended to have more residents with advanced educations and jobs that were considered "super-creative." In addition, people living in the happiest states are more relaxed than their gloomy counterparts; States like West Virginia and Mississippi, which scored high on neuroticism also showed lower well-being scores, those researchers reported in the Journal of Research in Personality.