Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/axic/skyscanner
A Ruby wrapper for the Skyscanner API.
https://github.com/axic/skyscanner
Last synced: 2 days ago
JSON representation
A Ruby wrapper for the Skyscanner API.
- Host: GitHub
- URL: https://github.com/axic/skyscanner
- Owner: axic
- License: mit
- Created: 2013-10-28T20:18:09.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2016-06-06T05:38:53.000Z (over 8 years ago)
- Last Synced: 2024-09-20T01:18:22.059Z (15 days ago)
- Language: Ruby
- Size: 176 KB
- Stars: 17
- Watchers: 3
- Forks: 9
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
skyscanner
==========A Ruby wrapper for the Skyscanner API. See http://business.skyscanner.net/portal/en-GB/AffiliateNetwork and
http://business.skyscanner.net/portal/en-GB/Documentation/Api for official documentation.Installation
------------**With Bundler**
In your Gemfile, add the following line
gem 'skyscanner', :require => 'skyscanner'
**Without Bundler**
gem install skyscanner
Usage
-----At the moment the interface is very simple and it only supports the Browse Cache Service API. Feel free to submit pull requests for more features.
Each of the four endpoints can be accessed with a class method reflecting the endpoint's name.
Skyscanner::Connection.browse_dates
Skyscanner::Connection.browse_grid
Skyscanner::Connection.browse_routes
Skyscanner::Connection.browse_quotes
Skyscanner::Connection.site_redirectOptions can be passed in a hash to these methods and they will be included in the request.
## Example from: http://www.skyscanneraffiliate.net/portal/en-GB/US/BrowseCache/BrowseQuotes
Skyscanner::Connection.browse_quotes({ :country => "GB", :currency => "GBP", :locale => "en-GB", :originPlace => "UK", :destinationPlace => "anywhere", :outboundPartialDate => "anytime", :inboundPartialDate => "anytime" })
# => GET http://partners.api.skyscanner.net/apiservices/browsequotes/v1.0/GB/GBP/en-GB/UK/anywhere/anytime/anytime?apiKey=prtl6749387986743898559646983194There are a number of class level options that can be overridden.
Skyscanner::Connection.apikey # the default API Key
Skyscanner::Connection.adapter # the Faraday adapter to use (default: :net_http)
Skyscanner::Connection.logger # a Logger object for logging requests (default: nil)
Skyscanner::Connection.protocol # http or https (default: :http)
Skyscanner::Connection.response_format # ruby, json, jsonp or xml (default: ruby)
Skyscanner::Connection.url # partners.api.skyscanner.net/apiservices/
Skyscanner::Connection.version # v.10
Example:Skyscanner::Connection.protocol
# => :http
Skyscanner::Connection.protocol = :https
# => :httpsThese options can also be overridden during instantiation of a Skyscanner::Connection
@secure = Skyscanner::Connection.new({:protocol => :https})
Copyright
---------Made for Soundtravel (http://soundtravel.co/).
Copyright (c) 2013 Alex Beregszaszi. See LICENSE for details.
Based on the SeatGeek Ruby API (https://github.com/bluefocus/seatgeek/) which is:
Copyright (c) 2012 Dan Matthews / Ticket Evolution ([http://ticketevolution.com](http://ticketevolution.com))