Hi orijing, I cover this in more detail elsewhere but the happiness is found through the ANEW dataset. This dataset scores a few thousand English words with sentiment values from 1 (very unhappy) to 9 (very happy). I find the happiness value for each word in a tweet and then average that value by the amount of words in a tweet to get the happiness value for each tweet.
The current version of ANEW can only be accessed for academic research. I do know that an older version is floating around in the open though, which they attached to a research paper.