Skip to content

conveyal/commuter-connections.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

commuter-connections

Find matches from CommuterConnections.org

URL

Base URL for requests from Commuter Connections

findMatches(opts)

Make a SOAP request to Commuter Connections to get the number of carpools available for a given starting, ending location, and search radius.

Parameters

parameter type description
opts Object Options object

Example

import {findMatches} from 'commuter-connections'
findMatches({
  startLat: 39.0436,
  startLng: -77.4875,
  endLat: 38.9047,
  endLng: -77.0164,
  startRadius: 2,
  endRadius: 2
}).then((matches) => {
  console.log(matches) // # of matches found
}, handleError)

Returns Promise, promise

verifyFindMatchesOptions(opts)

Verify find the options required for findMatches

Parameters

parameter type description
opts Object Options object

Example

import {verifyFindMatchesOptions} from 'commuter-connections'
const errors = verifyFindMatchesOptions(opts)
if (errors.length > 0) handleErrors(errors)

Returns Array, errors Errors found in the options

createSoapClient

Create a SOAP client to use with commuter connections.

Example

import {createSoapClient} from 'commuter-connections'
createSoapClient().then((client) => {
  // use the client
})

Returns Promise, promise

Installation

Requires nodejs.

$ npm install commuter-connections

Tests

$ npm test

About

Find matches from CommuterConnections.org

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published