CheapShark
Ruby wrapper for CheapShark's API.
Installation
Add this to your Gemfile and do a bundle install.
gem 'cheapshark'
Or install it yourself:
$ gem install cheapshark
Usage
require 'cheapshark'
CheapShark.games(title: 'Borderlands 2') # Returns an array of Game objects
CheapShark.games(title: 'Borderlands 2')[0] # Returns the likely most-relevant result
CheapShark.stores # Returns stores and their IDs
CheapShark.deals(storeID: 1, pageSize: 5) # Returns five best deals on Steam (CS sorts by deal rating by default)
CheapShark.deal(id: 'DCqsq6Hnmtzu2UVkBpD133kL1pG93Ovz4%2BEjTuJAx9c%3D') # Returns a specific deal.
Keep in mind that option names must be properly capitalized. The API will respond to storeID but ignore storeid.
CheapShark.deals(storeID: 1, pageSize: 5) # Right
CheapShark.deals(storeid: 1, pageSize: 5) # Wrong, will return five best deals from any store
CheapShark.deals(storeID: 1, pagesize: 5) # Wrong, will return the API default of sixty deals
CheapShark.deals(storeid: 1, pagesize: 5) # Very wrong, will return all deals
To-dos
- Decide on garbage-input scenarios to handle (things like calling
CheapShark.games()without params) - Alert feature
- Complete expectations.md
Contributing
- Fork it ( https://github.com/GA114/cheapshark/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