Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

active-activity-search

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

active-activity-search

Active.com Activity Search v2 HTTP API client.

  • 0.9.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
increased by200%
Maintainers
1
Weekly downloads
 
Created
Source

Active.com Activity Search v2 HTTP API client.

Build Status Code Climate js-standard-style

npm install active-activity-search --save
npm stats

npm NPM downloads Dependency Status

Example

Initialize
var client = require('active-activity-search')({
  key: '******',
  url: 'https://api.amp.active.com/v2/search' // optional as this is the default url
})
Callback
client
.query('basketball')
.category('event')
.city('Denver')
.state('CO')
.zip('80202')
.radius(50)
.search(function (error, data) {
  if (error) throw error
  console.log(data)
})
Promise
client
.query('basketball')
.category('event')
.city('Denver')
.state('CO')
.zip('80202')
.radius(50)
.search()
.then(function (data) {
  console.log(data)
})
.catch(function (error) {
  console.error(error.message)
})

Features

  • Supports all documented API query parameters.
  • Supports 12-factor configuration.
  • Accepts a traditional node-style callback otherwise, returns a promise.
  • Exposes a User-Agent request header including the name and version of the client.
  • Exposes a fluent interface.
  • Emits debug logs via DEBUG=active-activity-search*.

12-factor configuration example

ACTIVE_ACTIVITY_API_KEY="*****"
ACTIVE_ACTIVITY_API_URL="https://api.amp.active.com/v2/search" # optional as this is the default url

API

active([options])

Arguments

The following arguments can also be specified via environment variables.

  • [options]: (Object) options object.
    • [key]: (String) API key.
      • or process.env.ACTIVE_API_KEY
    • [url]: (String) API base URL.
      • or process.env.ACTIVE_API_URL
Returns
  • client: (Object) API client object.

.options() (read only)

Arguments
  • n/a
Returns
  • options: (Object) options object.

.set

Invoke corresponding accessor for each snake_cased parameter in given source object.

set({ show_suggest: true, query: 'running' })

NOTE: see http://developer.active.com/docs/read/v2_Activity_API_Search

Accessors

For each parameter a corresponding camelCased accessor (getter/setter) function is exposed.

  • All accessors are chainable.
  • Call accessor function w/o arguments and it will act as a getter.
  • Call accessor function w/ an argument and it will act as a setter.
functions
  • near
  • latLon
  • bbox
  • geoPoints
  • radius
  • showDistance
  • city
  • state
  • zip
  • country
  • query
  • currentPage
  • perPage
  • sort
  • facets
  • facetValues
  • category
  • categoryName
  • topic
  • topicName
  • metaInterest
  • metaInterestName
  • attributes
  • tags
  • startDate
  • endDate
  • cb
  • excludeChildren
  • includeEvergreenChildren
  • registerableOnly
  • exists
  • notExists
  • assetName
  • orgId
  • placeId
  • sourceSystemId
  • sourceSystemName
  • showSuggest
  • searchAgain
  • fields
  • assetGuid
  • substitutionUrl
  • authorName
  • reqMinAge
  • cityName
  • topicName

Resources

Licenses

GitHub license

Keywords

FAQs

Package last updated on 08 Jan 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc