Posted By

javadude on 12/27/09


Tagged

snipplr apache groovy xml-rpc


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

dharmamike


Accessing SNIPPLR with Groovy and Apache XML-RPC


 / Published in: Groovy
 

URL: http://www.bighugesystems.com/wordpress/?p=51

  1. import org.apache.xmlrpc.client.XmlRpcClient
  2. import org.apache.xmlrpc.client.XmlRpcClientConfigImpl
  3.  
  4. def XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl()
  5. config.setServerURL(new URL("http://snipplr.com/xml-rpc.php"))
  6. def XmlRpcClient client = new XmlRpcClient()
  7. client.setConfig(config)
  8.  
  9. Object[] params = ["[yourAPIkey]"]
  10. def result = client.execute("user.checkkey",params)
  11. println result
  12.  
  13. params = ["[yourAPIkey]","groovy"]
  14. result = client.execute("snippet.list",params)
  15. println result

Report this snippet  

You need to login to post a comment.