Advertisement
Guest User

Untitled

a guest
May 1st, 2013
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. # encoding: UTF-8
  2.  
  3. require 'xmlrpc/client'
  4.  
  5. # build a post
  6.  
  7. post = {
  8. 'title' => "$filename",
  9. 'description' => " [video][track kind=\"captions\" src=\"http://127.0.0.1/$filename\" srclang=\"en\" label=\"English\" default=\"true\"][/video]",
  10. 'mt_keywords' => ['a', 'list', 'of', 'tags'],
  11. 'categories' => ['a', 'list', 'of', 'categories']
  12. }
  13.  
  14. # initialize the connection
  15.  
  16. connection = XMLRPC::Client.new('127.0.0.1', '/xmlrpc.php')
  17.  
  18. # make the call to publish a new post
  19.  
  20. connection.call(
  21. 'metaWeblog.newPost',
  22. 1,
  23. 'root',
  24. 'root',
  25. post,
  26. true
  27. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement