Skip to content

Climb-social/climb-social

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Climb.social

Travis build

JS library for interacting with the Climb.social API.

Provides an RxJS Observable of pages of approved items for use in JS applications.

Looking for simple HTML embed code? Try the react-climb-social. There's also angular-climb and a simple JSONP REST API for you to choose from.

Description

The default exports of the module exposes a getStream method that accepts a collectionId which you can subscribe to.

Installation

npm install climb-social --save-dev

Usage

Make sure you've got a Climb.social account, you've made a new collection and you've approved some content.

Then note down your collectionId.

Getting approved items from your Climb.social collection

var climb = require('climb-social');

var collectionId = '561ba63445284e1740e016f7';

climb
    .getStream(collectionId)
    .subscribe(function(items) {

        // i.e. Do something with items:
        items.map(function(item) {
            console.log(item.author.username);
        });

    });

Specifying a polling interval

You can also specify how often you'd like to poll the Climb.social API for changes.

Pass a positive number (representing the number of seconds) as a second arg to getStream():

climb
    .getStream(collectionId, 40)
    .subscribe(function(items) {
        ...
    });
});