Programmed Under The Influence
Updating your Jaiku status revisited

After failing miserably trying to find a way to successfully updating my Jaiku status externally, I decided to give up. It has seemed like I had tapped all the resources online describing how you do it, but I just couldn’t get it to work on my end. My first attempt was following Jaiku’s instructions in using OAuth to connect to the site, but I soon found out that the callback URL pass doesn’t actually “call back” to your site. Anyway, I started trying my somewhat limited knowledge of cURL until I finally struck gold. Here’s what I got:


$username = "your_username";
$personal_key = "your_personal_key"; // Get yours here
$status = "your_status_message";
$icon = 300; // For the whole list go here
postToJaiku($username, $personal_key, $status, $icon);

function postToJaiku($username, $personal_key, $status, $icon = 300) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://api.jaiku.com/json");
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: application/json"));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "user=" . urlencode($username) .
"&personal_key=" . urlencode($personal_key) .
"&method=post&message=" . urlencode($message) . "&icon=" . $icon);

curl_exec($ch);
curl_close($ch);
}