Introduction

WineDotComApiRequest provides a simple no-frills interface to the Wine.com query API.

Its purpose is to eliminate the code duplication in setting up the request each time you which to receive information from the API.

It returns pure JSON or XML depending on which type of response you request.

Installation

To install, run:

$ sudo gem install wine_dot_com_api_request

Then, place your API key from wine.com in the lib/wine_dot_com_api_request/configuration.rb file.

Examples

To perform a request, follow the example below:

w = WineDotComApiRequest.new(:search => 'mondavi cabernet',
                             :format => :xml,
                             :resource => :catalog,
                             :size => 1,
                             :offset => 0)

res = w.query

View the documentation for possible search arguments.

The query routine will return either the raw XML or JSON request, depending on which you specify.

Documentation

You can generate documentation if you have the source by typing:

$ rake doc

Release Notes

First release.

Credits

WineDotComApiRequest is maintained by Christopher Meiklejohn. Contact me if you’d like to request any features or have any questions or feedback.

License

WineDotComApiRequest is Copyright 2010 Christopher Meiklejohn.

It is free software, and may be redistributed under the terms specified in the MIT-LICENSE file, which is attached below:

Copyright (c) 2010 Christopher Meiklejohn

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.