Novemberborn, Straight lines circle sometime

Jaiku: Online Presence and Automating

Back at Reboot 8.0 Jyri Engeström introduced us to Jaiku. Jaiku is an online presence service: you can post small notes about what you’re doing, either through the website or by texting or using the mobile application. Together with web feeds you can specify this is all combined into a presence stream. It’s much like Twitter, except prettier, cooler and European. And they have Andy!

Today I signed up, and set about automating the process. First off, there’s JaikuAdium by Peter Rukavina. This will set your Adium status to your current presence. Of course, you’ll still have to go to Jaiku to actually update your presence, so we can use some improvement.

Enter some HTTP reverse-engineering. Andy already told me they might inadvertently break the code below, so be warned. This tutorial is also for OS X. Here’s what you need to run in Terminal (you can remove the \ and the line break):

curl -b "jaikuuser_XXXX=username;jaikupass_XXXX=XXXX" \
-d "icon=338" -d "message=Hello+world" --url http://jaiku.com/

The jaikuuser_XXX and jaikupass_XXX are the cookies used by Jaiku which contain your login credentials. You’ll have to retrieve these from the browser. Please note that the XXXX is a long string of letters and digits. The presence icon is identified by a number, I’m not sure of the mapping between the icons and their IDs, so you’ll just have to try. 338 is the exclamation-mark-in-a-text-balloon icon. And finally, message is exactly what you think it is. Take care to properly encode it’s contents though, it shouldn’t include whitespace, ampersands and probably some other characters.

Here’s a Ruby script which updates your presence and Adium status at the same time:

#!/usr/bin/ruby

require 'cgi'

`curl -b "jaikuuser_XXXX=username;jaikupass_XXXX=XXXX" 
-d "icon=338" -d "message=#{CGI.escape(ARGV.join(' '))}" --url http://jaiku.com/`

`osascript /Applications/JaikuAdium/JaikuAdium.applescript`

Here I’ve placed the JaikuAdium script in /Applications/JaikuAdium/. Update the login credentials as mentioned above. Then, call the script with the presence message as it’s argument(s).

Enjoy!

link | Jaiku | 23 November 2006, 20:28


Comments

  1. Thanks Mark. I used your code to make an automator workflow that asks me for a new status every so often and updates Jaiku. The Adium bit was crashing Adium though. Not sure why.

    Rowan Nairn | 29 November 2006, 08:51 | link

  2. Rowan, that’s a nice idea! Not sure about Adium, I’m using beta 15 so you might want to try with that.

    Mark Wubben | 29 November 2006, 09:33 | link

Leave your comment

Please keep it polite and on topic. Yes, your e-mail address is required, but it's kept private. HTML is not allowed in the comments but you can use Markdown. Non-contributing comments run the risk of being removed. Especially if the website seem “fishy”. Spammers, beware.

(required)
(required, kept private)
(optional, but let's share it!)
(required)

Remember my details


Novemberborn: Extra

About the author

Mark Wubben is a European Dutchman and web hacker, based in Copenhagen, Denmark. Supercollider is Mark's freelance alter-ego.

Read more about Mark...

Go to

Jobs (NL)

Xopus zoekt programmeurs! Verbeter de code en win!

Subscribe