Unofficial Realeyes Data Api Client for Ruby
Add this line to your application's Gemfile:
gem 'realeyes'
And then execute:
$ bundle
Or install it yourself as:
$ gem install realeyes
Initialization
conn = Realeyes::Connection.new(access_key: 'access', secret_key: 'secret')
# or set custom base url, by default it's 'http://reportingapi.realeyesit.com/api/v1/'
conn = Realeyes::Connection.new(access_key: 'access', secret_key: 'secret', base_url: 'http://...')
Get methods
conn.get('GetStudies') # => Net::HTTPOK Object
conn.get('GetStudies').code # => 200
conn.get('GetStudies').body # => '[{"Id": 1,"Name":"My Study"}, ...]'
# add params hash as second parameter
conn.get('GetMediaByYouTubeHash', {YouTubeUrlHash: 'nXRJqNSoL9'})
Post methods
# post(method, body, params)
conn.post('UpdateCollection', {Name: 'New Name'}, {UrlHash: 'nXRJqNSoL9'})
- Add services and response objects ( Media.find_by_hash('nXRJqNSoL9').update(name: 'New Name') )
- Fork it ( https://github.com/[my-github-username]/ruby-realeyes/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request