cove-api
A node.js module for accessing the PBS COVE V1 API. See COVE API Documentation:
Dependencies
- COVE API_ID
- COVE API_SECRET
Install
$ npm install cove-api
Test
$ npm test
Usage
Quick start
This example queries COVE for programs produced by PBS and requests the associated images.
$ cd examples
$ export COVE_API_ID='YOUR COVE_API_ID'
$ export COVE_API_SECRET='YOUR COVE_API_SECRET'
$ node simple_request.js
Output:
Async: results count: 200
Async: first image url: http://image.pbs.org/contentchannels/2340/MmFmdUNelPiWY1fJnGw.jpg.resize.144x81.jpg
Promises: results count: 200
Promises: first image url: http://image.pbs.org/contentchannels/2340/MmFmdUNelPiWY1fJnGw.jpg.resize.144x81.jpg
Promises w/ Header Auth: results count: 200
Promises w/ Header Auth: first image url: http://image.pbs.org/contentchannels/2340/MmFmdUNelPiWY1fJnGw.jpg.resize.144x81.jpg
Sample Code
var COVEApi = ; // Get api credentials from Environmentvar api_id = processenvCOVE_API_ID || null api_secret = processenvCOVE_API_SECRET || null; // A sample URL. Returns images for PBS programsvar url = 'http://api.pbs.org/cove/v1/programs/?filter_producer__name=PBS&fields=associated_images'; var options = api_id : api_id api_secret : api_secret log_level : 'debug';var coveAPI = options; var options = {};coveAPI;