Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'xmlrpc/client'
- # build a post
- post = {
- 'title' => 'Post Title 2',
- 'description' => 'http://www.demo/video.mp4',
- 'mt_keywords' => ['a', 'list', 'of', 'tags'],
- 'categories' => ['a', 'list', 'of', 'categories']
- }
- # initialize the connection
- connection = XMLRPC::Client.new('129.0.0.01', '/xmlrpc.php')
- # make the call to publish a new post
- connection.call(
- 'metaWeblog.newPost',
- 1,
- 'username',
- 'pass',
- post,
- true
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement