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

Development

~> 1.2
~> 12.0
~> 3.6
~> 2.3

Runtime

 Project Readme

cortex-client-ruby

Build Status Gem Version

Ruby client library for cortex's API.

Constructor

require 'cortex-client'

client = Cortex::Client.new(access_token: 'access_token')

client.posts.query().each do |post|
  puts post
end

Alternatively, 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().each do |post|
  puts post
 end

Authorization

For more information about scopes and how to obtain an application key and secret, check Cortex's authorization documentation.

Result object

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

Supported Endpoints

  • Users - me, get, save
  • Posts - query, get, save, delete, feed, feed/get, feed/get/released, feed/authors
  • Webpages - feed

TODO

  • Support Media endpoint