Advertisement
Guest User

Untitled

a guest
Apr 25th, 2013
270
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. require 'xmlrpc/client'
  2.  
  3. # build a post
  4.  
  5. post = {
  6. 'title' => 'Post Title 2',
  7. 'description' => 'http://www.demo/video.mp4',
  8. 'mt_keywords' => ['a', 'list', 'of', 'tags'],
  9. 'categories' => ['a', 'list', 'of', 'categories']
  10. }
  11.  
  12. # initialize the connection
  13.  
  14. connection = XMLRPC::Client.new('129.0.0.01', '/xmlrpc.php')
  15.  
  16. # make the call to publish a new post
  17.  
  18. connection.call(
  19. 'metaWeblog.newPost',
  20. 1,
  21. 'username',
  22. 'pass',
  23. post,
  24. true
  25. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement