Skip to content

Instantly share code, notes, and snippets.

@rolandoam
Created June 8, 2009 00:08
Show Gist options
  • Save rolandoam/125541 to your computer and use it in GitHub Desktop.
Save rolandoam/125541 to your computer and use it in GitHub Desktop.
testing xmlrpc on cocos2d forum
# xmlrpc is stdlib
require 'xmlrpc/client'
require 'pp'
user = "user"
pass = "mypass"
url = "http://www.cocos2d-iphone.com/forum/xmlrpc.php"
server = XMLRPC::Client.new2(url)
# note: this call works even if authentication fails!
result = server.call("demo.sayHello", user, pass)
pp result
# all methods/arguments are here:
# http://trac.bbpress.org/browser/trunk/xmlrpc.php
#result = server.call("bb.getTopics", user, pass, 2) # 2 is forum id
#pp result
msg = {
'forum_id' => 2,
'title' => 'test from xmlrpc',
'text' => 'this is a test from xmlrpc',
'tags' => 'fake,test'
}
# msg is just a hash with the required keys
result = server.call("bb.newTopic", user, pass, msg)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment