#!/usr/bin/env ruby $LOAD_PATH.unshift File.join(File.dirname(__FILE__), *%w(.. lib)) require 'VIAJERO' market = ARGV[0] currency = ARGV[1] locale = ARGV[2] originPlace = ARGV[3] destinationPlace = ARGV[4] outboundPartialDate = ARGV[5] unless market && currency && locale && originPlace && destinationPlace && outboundPartialDate puts 'arguments are need for skyscanner method(market currency locale originPlace destinationPlace outboundPartialDate)' exit(1) end unless ENV['SKYSCANNER_API'] puts 'you haven\'t set your environment variable yet' exit(1) end flight = Skyscanner::FlightInfo.find(market: market, currency: currency, locale: locale, originPlace: originPlace, destinationPlace: destinationPlace, outboundPartialDate: outboundPartialDate) flightInfo = flight.flightInfo puts flightInfo