Artur Bergman (crucially) wrote,
Artur Bergman

  • Mood:

LJ Mood

So I have always wanted an Ambient Orb, but haven't been able to get one because they don't work outside the US, now that I am here I am free to play with them. Ben Trott kindly gave me one he wasn't using to play with.

After a night of hacking with daveman692 we managed to hook up the orb to the mood of livejournal. It was a nice piece of hacking and it felt nice to be actually just hack on a nice little project.

Essentially we are requesting the latest posts feed every 10 seconds, parsing out the lj:mood tag and aggregating it up for 10 minutes, then we walk through and calculate the percentages of moods against a list of moods and values between 0 (good) to 100 (bad). This ends up with a plot on the scale somewhere between 0 and 100 with 50 in the middle. The list of moods was made very unscientifically by me and daveman692 and we stumbled on some. (How would you rate "iced").

Then we keep track of the min and max we have ever seen and the point we are currently in between, so we can self calibrated. We realised that using the absolute value wouldn't really work since it would never move very far away from midpoint.

All in 50 lines of code or so.

This morning it wasn't very happy.

But as the day progresses it has gotten a bit more happy.

Now I want to add lj:mood data to the atom stream.
Tags: hack, lj, mood

  • Post a new comment


    default userpic

    Your reply will be screened

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.