An experimental (and very limited!) unofficial Ruby client for the ghost.org / ghost.io blogging platform API.
If not explicitly passed a client, all methods will fall back to
Client.default_client
. You can set that default client directly or
have it auto-constructed from a set of default options:
Has no default, must be provided.
The Client ID used for Client Authentication. See http://api.ghost.org/docs/client-authentication#client-restrictions for details on how to obtain that information.
Has no default, must be provided.
The Client Secret used for Client Authentication. See http://api.ghost.org/docs/client-authentication#client-restrictions for details on how to obtain that information.
Optional
A Faraday connection builder. Defaults to:
->(builder) {
builder.adapter Faraday.default_adapter
builder.request :url_encoded
builder.response :parse_json
}
Optional
A Hash
of options passed as the second parameter to
Faraday::Connection.new
.
Has no default, optional
For ghost.io hosted ghost instances, set this to your ghost.io subdomain, i.e.
the word preceding ghost.io
in the URL of your blog's administration
interface.
For self-hosted instances, you probably want to keep the subdomain
empty and
overwrite url_base
instead.
Optional
Defaults to ->(client) { "https://#{client.subdomain}.ghost.io/ghost/api/v0.1" }
.
You should generally only overwrite this if you self-host your ghost instance.
Posts.list(fields: nil, filter: nil, include: nil, limit: 15, order: "published_at desc", page: 1)
All responses are returned as a Hash
with all keys and values exactly
as described in the API Reference Documentation.
So far, this has only been verified to work on Ruby (MRI) 2.3.3. I have no plans to support any Ruby versions below 2.3.
This library is in a very early stage, only supports a very limited subset of the API and further e.g. does not yet feature any automated tests, nor does it significantly transform any API responses, provide convenience helpers, etc.
At the moment, The following APIs are supported: