This Ruby code uses the ProjectX API on rorbuilder.info to send a post to Jaiku.
Prerequisites:
1) You have a Jaiku account. see http://jaiku.com/
2) You know your Jaiku API key. see http://api.jaiku.com/
require 'net/http'
require 'rexml/document'
include REXML
class ProjectXClient
attr :doc
def initialize(raw_url)
url = URI.escape(raw_url)
xml_data = Net::HTTP.get_response(URI.parse(url)).body
@doc = Document.new(xml_data)
end
end
if __FILE__ == $0
xml_project = <<PROJECT
<project name='jaiku'>
<methods>
<method name='post'>
<params>
<param var='user' val='YourJaikuUserName'/>
<param var='msg' val='YourMessage'/>
<param var='location' val='YourCity'/>
<param var='apikey' val='YourApiKey'/>
</params>
</method>
</methods>
</project>"
PROJECT
pxc = ProjectXClient.new("http://rorbuilder.info/api/projectx.cgi?xml_project=" + xml_project)
doc = pxc.doc
puts doc
end
You can also pass the url including xml into the address bar and it will post to Jaiku successfully.
eg.
http://rorbuilder.info/api/projectx.cgi?xml_project="<project name='jaiku'><methods><method name='post'><params><param var='user' val='jrobertson'/><param var='msg' val='testing 223'/><param var='location' val='London'/><param var='apikey' val='5ugr6ttr754y214445'/></params></method></methods></project>"
Note:
Your api key is not in any way stored by the website rorbuilder.info.
Rorbuilder.info is a 3rd party developer website which is not part of Jaiku.com.