skyscanner-liveflights-api
v0.1.0
Published
[](https://circleci.com/gh/jameshopkins/skyscanner-liveflights-api) [.fork(
console.error,
console.log
);Notes
Supported parameters
Currently the only supported parameters are:
adultscabinclassoriginplaceoutbounddate,inbounddate,destinationplace
Usage Interfaces
If you inspect the source code, you'll notice that all integral functionality is encapsulated in function compositions.
This concept means that, if required, you can build your own custom interface of skyscanner-liveflights-api - itself, a composition of functions.
For example, the main entrypoint, is a composition of two other functions (pollForResults and createSession) that, when used together, make up the standard interface.
You could very easily extend this continutation. E.g
import { compose, lensProp, lensIndex, map, view } from 'ramda';
import submitQuery from 'skyscanner-liveflights-api';
const focusLens = compose(lensProp('Itineraries'), lensProp(0));
const focusOnItineraryItem = map(view(focusLens)))
const getTheFirstItemInTheItinerary = compose(
focusOnItineraryItem,
submitQuery
);
getTheFirstItemInTheItinerary({
adults: 1,
cabinclass: 'Economy',
originplace: 'SFO-iata',
outbounddate: '2017-03-24',
inbounddate: '2017-05-30',
destinationplace: 'BOS-iata'
}).fork(
console.error,
console.log
);
Debugging
debug is supported, so you can log the individual transactions in the orchestration to stdout, by prepending DEBUG=skyscanner-liveflights-api to the script that starts your consumer application.
Running Tests
make test
# OR
make coverageContributing
- Fork the repo and create your branch from
master yarn- Add tests
- Do your shizzle
- Create a PR
