Difference between revisions of "Class.jaiku.php"
(Added info about GUI.) |
|||
Line 29: | Line 29: | ||
If you're running OS X, you can use [http://www.bluem.net/downloads/pashua_en/ Pashua] to wrap a simple GUI around the class ([http://ruk.ca/article/3990 screen shot here]). I've included the [http://websvn.reinvented.net/filedetails.php?repname=Jaiku&path=%2FJaikuPHP%2FJaikuGUI.php&rev=0&sc=0 source code for this]; it's easy to modify to suit your application and preferences. | If you're running OS X, you can use [http://www.bluem.net/downloads/pashua_en/ Pashua] to wrap a simple GUI around the class ([http://ruk.ca/article/3990 screen shot here]). I've included the [http://websvn.reinvented.net/filedetails.php?repname=Jaiku&path=%2FJaikuPHP%2FJaikuGUI.php&rev=0&sc=0 source code for this]; it's easy to modify to suit your application and preferences. | ||
+ | |||
+ | You can run the Pashua-based code from the command line or, if you want to go one step further, use Platypus to convert the script into a ''bona fide'' OS X application; here's a screen shot of my settings for doing so: | ||
+ | |||
+ | [[Image:PlatypusJaiku.png]] | ||
+ | |||
+ | To get the Jaiku icon in there, I simply cut and paste it from Jaiku.com (for demonstration purposes only; if you build the app for distribution that would probably be a [http://jaiku.com/terms Bad Thing]) | ||
==Known Issues== | ==Known Issues== | ||
There's no error reporting at all, so if it fails, you'll never know. | There's no error reporting at all, so if it fails, you'll never know. |
Revision as of 18:35, 21 December 2006
class.jaiku.php is an PHP5 class that allows for basic interaction with Jaiku. At present the useful functionality is limited to updating your Jaiku presence programmatically.
Jaiku doesn't have a public API yet, so all of the magic is done be sending standard HTTP POSTs to Jaiku.com -- pretending to be a web browser, in other words.
Source Code
You can browse the source code from a browser, or grab the latest version of the source code using Subversion at:
You can grab the latest version of the source code using Subversion at:
svn://svn.reinvented.net/Jaiku/JaikuPHP
or
http://svn.reinvented.net/Jaiku/JaikuPHP
Sample Usage
require_once("class.jaiku.php"); $j = new Jaiku("username","password"); $j->GetJaikuSession(); $j->UpdatePresence("Updating my presence from PHP!","My City, My Country",'333');
Assuming you have a Jaiku.com account, and you substitute the proper values for "username" and "password," this code should update your Jaiku presence, location and icon: visit Jaiku.com to see if it worked.
Giving the Code a GUI
If you're running OS X, you can use Pashua to wrap a simple GUI around the class (screen shot here). I've included the source code for this; it's easy to modify to suit your application and preferences.
You can run the Pashua-based code from the command line or, if you want to go one step further, use Platypus to convert the script into a bona fide OS X application; here's a screen shot of my settings for doing so:
To get the Jaiku icon in there, I simply cut and paste it from Jaiku.com (for demonstration purposes only; if you build the app for distribution that would probably be a Bad Thing)
Known Issues
There's no error reporting at all, so if it fails, you'll never know.