No commit activity in last 3 years
No release in over 3 years
Wordpress API Wrapper.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
>= 0

Runtime

>= 0.8
>= 1.2
 Project Readme

wordpress-client

Gem Version Build Status Coverage Status

wordpress-client is a Wordpress Rest API Wrapper.

Requirements

I test with ruby 1.9.3 and 2.1.0. Other versions/VMs are untested but might work fine.

Installation

To your system

gem install wordpress-client

Or add wordpress-client to your Gemfile and bundle install:

gem 'wordpress-client'

Usage

Create new client

require 'wordpress-client'

# Shared client
client = Wordpress.client

# New client
client = Wordpress::Client.new

Call API without access token

# Get posts of a specific domain without access token
posts = client.get_posts('wordpress-site-domain')
posts.each do |post|
  # Do something
end

# Get all the posts of a specific domain without access token
page = 1
loop do
  posts = client.get_posts('wordpress-site-domain', :page => page)
  posts.each do |post|
    # Do something
  end
  break if posts.size == 0
  page += 1
end

Call API with access token

# Get user by access token
client.access_token = 'YOUR_ACCESS_TOKEN' # if you have any
user = client.me
site = user.site
posts = site.posts

TODO

  • Support create/update/delete from Wordpress::Object
  • Add oauth method

Contributing

See the contributing guide.

Copyright

Copyright (c) 2013-2013 Daisuke Taniwaki. See LICENSE for details.