Sha256: e4c9f0b724fabee51983b5fb9f9f7258698ce97c39a60cef8b8891f1bb3be4f1
Contents?: true
Size: 1.6 KB
Versions: 4
Compression:
Stored size: 1.6 KB
Contents
cloudsight-ruby =============== A simple CloudSight API Client | Project | Gem Release | |------------------------ | ----------------- | | gem name | gem-release | | version | [](http://badge.fury.io/rb/gem-release) | | continuous integration | [](https://travis-ci.org/cloudsight/cloudsight-ruby) | Installation ============ ``` $ gem install cloudsight ``` Install the `simple_oauth` gem to use with oauth options. ``` $ gem install simple_oauth ``` Configuration ============= ```ruby require 'rubygems' require 'simple_oauth' require 'cloudsight' Cloudsight.oauth_options = { consumer_key: 'REPLACE WITH YOUR KEY', consumer_secret: 'REPLACE WITH YOUR SECRET' } ``` or, using a single API key: ```ruby require 'rubygems' require 'cloudsight' Cloudsight.api_key = 'REPLACE WITH YOUR KEY' ``` Usage ===== Send the image request using a file: ```ruby requestData = Cloudsight::Request.send(locale: 'en', file: File.open('image.jpg')) ``` Or, you can send the image request using a URL: ```ruby requestData = Cloudsight::Request.send(locale: 'en', url: 'http://www.google.com/images/srpr/logo11w.png') ``` Then, use the token to retrieve the response: ```ruby responseData = Cloudsight::Response.get(requestData['token']) ``` You can also use the `retrieve` method which will poll for the response for you: ```ruby Cloudsight::Response.retrieve(requestData['token']) do |responseData| p responseData end ```
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
cloudsight-0.0.5 | README.md |
cloudsight-0.0.4 | README.md |
cloudsight-0.0.3 | README.md |
cloudsight-0.0.2 | README.md |