Posted By

olivernautsch on 05/11/07


Tagged

xml-rpc


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

mafro


access snipplr with groovy via XML-RPC


 / Published in: Groovy
 

URL: www.nautsch.net

simple example and my first entry in snipplr

  1. package net.nautsch.snipplr;
  2.  
  3. import org.apache.xmlrpc.client.XmlRpcClient;
  4. import org.apache.xmlrpc.client.XmlRpcClientConfigImpl;
  5.  
  6. class SnipplrRunner {
  7.  
  8. static void main(args) {
  9. XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl()
  10. config.setServerURL(new URL("http://snipplr.com/xml-rpc.php"))
  11.  
  12. XmlRpcClient client = new XmlRpcClient()
  13. client.setConfig(config)
  14. Object[] params = ["<insert your id here>"]
  15.  
  16. def boolean result = client.execute("user.checkkey", params)
  17. println result
  18. }
  19. }

Report this snippet  

You need to login to post a comment.