Ruby client library for cortex's API.
require'cortex-client'client=Cortex::Client.new(access_token: 'access_token')client.posts.query().eachdo |post|
putspostendAlternatively, cortex-client will handle OAuth2 authentication for you:
require'cortex-client'client=Cortex::Client.new(key: 'my-app-id',secret: 'my-app-secret',base_url: 'base_url',scopes: 'view:posts view:media')client.posts.query().eachdo |post|
putspostendFor more information about scopes and how to obtain an application key and secret, check Cortex's authorization documentation.
Cortex::Client will return a Cortex::Result object. The following methods are available:
- contents
- is_error?
- errors
- page
- per_page
- total_items
- range
- range_start
- range_end
- raw_headers
- Users - me, get, save
- Posts - query, get, save, delete, feed, feed/get, feed/get/released, feed/authors
- Webpages - feed
- Support Media endpoint