access snipplr with groovy via XML-RPC


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

simple example and my first entry in snipplr


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

URL: www.nautsch.net

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.