Charl van Niekerk » Blog

Main

Latest

Archives

Powered by Blogger

Plurk PHP Post Script

Plurk seems to be the latest South African internet obsession. As various people including Stii mentioned, Plurk lacks an API. That never got me down though. Most people would probably like to have a script to post updates, so I thought I should start with that.

<?php
$curl = curl_init();
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_COOKIEJAR, 'cookie.txt');
curl_setopt($curl, CURLOPT_COOKIEFILE, 'cookie.txt');
curl_setopt($curl, CURLOPT_URL, 'http://www.plurk.com/Users/login');
curl_setopt($curl, CURLOPT_POSTFIELDS, 'nick_name=noob&password=pwned');
curl_exec($curl);
curl_setopt($curl, CURLOPT_URL, 'http://www.plurk.com/TimeLine/addPlurk');
curl_setopt($curl, CURLOPT_POSTFIELDS, 'qualifier=%3A&content=' . urlencode('i r l33t h4x0r') . '&lang=en&no_comments=0');
curl_exec($curl);
curl_close($curl);

The script is simple enough to be self-explanatory but please comment if you have any questions.

2 Comments

Comment by Anonymous Neville Newey on Wednesday, June 04, 2008 9:05:00 PM

Nice one Charl! Will try a Pythonised version and report back :)
I have given up trying to use Jabber for automated posts, their Jabber support is just too dodgy right now.

Comment by Blogger Charl van Niekerk on Wednesday, June 04, 2008 10:12:00 PM

Yeah the Jabber support is really scaly at the moment unfortunately.... I hope they manage to sort that out soon as that's a major thing for me personally.

Post a Comment

Copyright © 2004-2009 Charl van Niekerk. All articles are released under the Creative Commons Attribution 2.5 South Africa licence, unless where otherwise stated.