metaweblog - Ruby client for metaWeblog API
This gem makes it easier for you to talk with your blog apps via metaWeblog API.
Installation
Add this line to your Gemfile:
gem 'metaweblog'
And then execute:
$ bundle
Or install it yourself as:
$ gem install metaweblog
Usage
Setup a client
client = MetaWeblog::Client.new('http://yourblog.example.com/xmlrpc.rb', # XML-RPC endpoint
'your_blog_id', # Blog ID
'username', # username
'password', # password
'proxy.example.com') # (Optional) proxy
Post new entry
require 'metaweblog'
post = MetaWeblog::Post.new('Title', 'Body')
client.post(post)
MetaWeblog::Client#post
returns post_id
of new entry if the entry is posted successfully.
Get an existing entry
Just calling get
method with post_id:
post = client.get(post_id)
Edit an existing entry
modified_entry = MetaWeblog::Post.new('Fixed Title', 'Fixed Contents')
client.edit(post_id, modified_entry)
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request