Coder Social home page Coder Social logo

wp_ruby_api's Introduction

Wordpress Ruby API

How to integrate your Wordpress Blog in your Rails App (or any Ruby App)? Enter this simple API Wrapper, which makes use of the excellent JSON plugin for wordpress by Dan Phiffer.

Requirements

Configuration

Somewhere in your app (e.g. in an initializer file in Rails):

WpRubyApi::Base.site = "http://path/to/your/wordpress-blog"

If you have permalinks enabled in wordpress:

WpRubyApi::Base.permalinks = :enabled

This setting translates the request to either blog-path/api/json_method?params or blog-path?json=json-method&params. This is part of the JSON API.

Usage

Start your app or hop into the console. You should be able to use methods like this:

WpRubyApi::Post.all
WpRubyApi::Post.find(3)
WpRubyApi::Post.search("my search term")
WpRubyApi::Post.by_category("my-category")
WpRubyApi::Page.find('about')
WpRubyApi::Comment.create({:name => "John Doe", :email => "[email protected]", :content => "This is a comment!", :post_id => 1}) (requires activation in JSON API)

For more methods and documentation take a look at the code.

Installation

Currently only available as a rails plugin.

TODOs

  • docs

  • tests

  • gemify

Project Info

Thanks to John Nunemaker for creating HTTParty. It’s awesome!

Copyright © 2010 Daniel Schoppmann, released under the MIT license

wp_ruby_api's People

Contributors

dansch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

wp_ruby_api's Issues

Can I create new post?

Hi, there is a way to publish a new post by this API?
I saw a 'create' method only in Comment model.

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.