Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # encoding: UTF-8
- require 'xmlrpc/client'
- # build a post
- post = {
- 'title' => "$filename",
- 'description' => " [video][track kind=\"captions\" src=\"http://127.0.0.1/$filename\" srclang=\"en\" label=\"English\" default=\"true\"][/video]",
- 'mt_keywords' => ['a', 'list', 'of', 'tags'],
- 'categories' => ['a', 'list', 'of', 'categories']
- }
- # initialize the connection
- connection = XMLRPC::Client.new('127.0.0.1', '/xmlrpc.php')
- # make the call to publish a new post
- connection.call(
- 'metaWeblog.newPost',
- 1,
- 'root',
- 'root',
- post,
- true
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement