Here's my useless app to determine your Twitter mood :D

Over the weekend I decided to try something new, so I dove into Sinatra and created a simple application.

(Heavily) Inspired by Beak, I present to you Chirp ( – the tool to determine your Twitter mood. :wink:

It does some basic sentiment analysis (thank to this ruby gem) on some tweets and returns your score.

One thing that could be improved is connecting to the Twitter API which only returns 20 tweets. I’m wondering if I can bump that up… (Any ideas? I’m using the Twitter gem.)

Nick, why on earth would you create this useless application?

I found 3 reasons:

  1. The experience. I’d never touched Sinatra before, and creating the app taught me some new things.
  2. A ‘hack’ under my belt. A portfolio piece. Something to show people… Even if it is useless!
  3. Who knows, it may become popular. And if so, that may help with getting the next project off the ground.

It’s lacking in features at the moment, but I’ll get back to it later today. I plan to add leaderboards and the ability to challenge others with your happiness(!!!).

Let me know what you think! At the time of writing this, my ‘chirpscore’ is 2.72, which makes me a cheerful tweeter. I have yet to find an angry tweeter – I’ll be on the lookout.


UPDATE: Added leaderboards (limited to 5 per – Twitter rate limiting is already becoming an issue…).


Good one mate, just tried it. 1.55 and a pleasant tweeter :smile: Need to up my game!!! :sunny:

1 Like

Neat. I scored 3.3, which is suprising. I thought I was a grumpy tweeter.

It looks like you don’t have analytics on it. How are you tracking activity? Logs?

Almost true… I haven’t bother with it just yet (not sure why…) – I’ve linked it to Heap Analytics, just need to set it up!

Bare in mind the score can be dodgy - it’s not semantic, but scores on a word-by-word basis.

EDIT: It turns out just linking it to Heap caused it to start tracking which is nice! It’s not as feature-full as GA, but does a nice job :slight_smile:

If I can offer some constructive criticism… IMO, the place holder text in the text box on the homepage needs to be disappear (or at least fade out a little) when you click into it. it confused me yesterday when I first looked at it, as I thought that the cursor had landed in the middle of the pre-existing text, and that I’d have to delete it. Nothing major, just something which I thought would help.

As for the score page - I think it might be worth adding some type of graphic which represents the score in some way. I’m not sure what the range is, but I’m sure you can find some royalty free images to represent this.

Are you planning on open sourcing this? I’d love to see your code :smile:

(PS, I got a score of 2.28)

1 Like

W00t! I am a happy tweeter with a score of 4.84. It’s interesting that news twitter accounts are the unhappiest.

Nice work @nick. I do agree with @LimeBlast and the placeholder text though. I think I’d have been confused for a moment if I hadn’t just read about it.

To deal with the rate limiting you could add some caching with redis or memcached so that you only need to go out to twitter once for a user and/or you could cache the lists until it needs to change. Happy to give you a few pointers if you like.

A simple way to do the caching is just to the save the JSON results to a file, it’s fast, simple and doesn’t really use any RAM (though if there is some free it will be cached in RAM)

Good idea, sorted it! Makes it nicer indeed :smile:

I’ll look into that, a coherent set of emoticons would be nice… There are 11 ‘moods’ in total, from angry to ecstatic. Aren’t the ones used by iMessage and WhatsApp free? I’ll take a look. However, first I want to implement a ‘chirp challenge’ feature…

Does having a public GitHub repo count as open-source? If so: It’s not test-driven (:S), and the code may look ugly, and the README is slightly bare. The big comment in app.rb is there because I couldn’t get Compass/Sass to work for some reason…

That would be helpful! :smiley: The problem isn’t with the user score (yet?) I believe, but instead the profile photos of which 10 are loaded on each homepage refresh. And to be honest, I have no idea how to store/cache a static asset like an image… Any pointers would be much appreciated!

So after a couple of hours tearing my hair out with static assets and the like, I finally sorted the problem. The app now downloads the profile photos and no longer requests them each time from Twitter. Although it could do with a way to check whether someone has updated their picture…

I shouldn’t laugh, but I love your commit messages…

1 Like

Damn… I was hoping you wouldn’t notice. They crack me up too, I was tired and frustrated :blush:

Proudly sponsored by Bytemark