Accessing SNIPPLR with Groovy and Apache XML-RPC


/ Published in: Groovy
Save to your folder(s)



Copy this code and paste it in your HTML
  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

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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.