mispy/kaomojify — pull request #7 by elena-v2 (2014-02-07 21:10:13+00:00)
Title: Fix error when name+kaomoji is > 20 characters.

20 characters is currently the limit for display names for Twitter.

It's probably hackish (I'm honestly not a ruby dev at ALL), but it'll try to run ten times in the hopes of getting a combination that fits within size constraints. If it doesn't, then it'll abort by returning nil in Kaomojify::Updater.run instead of spitting out an error.

I broke out the tweet history classification and made best an instance variable simply because we only need to run the classifier once for a given data set, but we might need to retrieve several kaomojis for the dominant emotion.