Skip to content

djcp/ruby-wordpress-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rubypress

Gem Version

This implements the WordPress XML RPC API as released in version 3.4.

WARNING: SSL is NOT enabled by default for ease of testing for those running OS X systems without setup SSL certs. If this is important to you, checkout the options for instantiating a new client where you can set :use_ssl to true.

Getting Started

  1. Install the gem

    A. To your system

    gem install rubypress

    B. Or using Bundler

    Inside your Gemfile:

    gem 'rubypress'

  2. Create a new client

    > wp = Rubypress::Client.new(:host => "yourwordpresssite.com", :username => "yourwordpressuser@wordpress.com", :password => "yourwordpresspassword")
  3. Make requests based off of the WordPress XML RPC API Documentation

    > wp.getOptions
    
    => {"software_name"=>{"desc"=>"Software Name", "readonly"=>true, "value"=>"WordPress"}

    (just a small excerpt of actual options for the sake of the whole brevity thing)

    > wp.newPost(:blog_id => "your_blog_id", :content => { :post_status => "publish", :post_date => Time.now, :post_content => "What an awesome post", :post_title => "Woo Title" })  
    => "24"  

    (returns a post ID if post was successful)

To make further requests, check out the documentation - this gem should follow the exact format of the WordPress XML RPC API. For even further clarification on what requests are available, take a look in the spec folder.

Contributing to rubypress

Pull requests welcome.

  • Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
  • Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
  • Fork the project.
  • Start a feature/bugfix branch.
  • Commit and push until you are happy with your contribution.
  • Make sure to add tests for it. This is important so we don't break it in a future version unintentionally.
  • Submit a pull request

Credits

License

Licensed under the same terms as WordPress itself - GPLv2.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages