5.0.2 • Published 8 years ago

dbc-node-recommendations v5.0.2

Weekly downloads
10
License
GPL-3.0
Repository
github
Last release
8 years ago

dbc-node-recommendations

David David

Client for the DBC Recommendation service

The service returns a list of recommendations for a given profile (a list of manifestations)

Example

import Recommendation from 'dbc-node-recommendation'

// Setup service 
const endpoint = 'http://url.to.service/';
const filters = ['rec.collectionIdentifier:775100-katalog'];
let recommendation = Recommendation(endpoint, filters);

// Parameters is an object containing likes and dislikes of DBC well identifiers
const params = {
  like: [
   '870970-basis:44582937',
   '870970-basis:42307963',
   '870970-basis:26488303',
   '870970-basis:29008736',
   '870970-basis:25801253',
   '870970-basis:25490487',
   '870970-basis:43266403',
   '870970-basis:40456775',
   '870970-basis:25254996',
   '870970-basis:20414642',
   '870970-basis:27088988',
   '870970-basis:23202182',
   '870970-basis:43847546',
   '870970-basis:44777010'
  ],
  dislike: []
};

// Make response
recommendation.getRecommendations(params)
  .then((reponse) => {
    // Everything went well
    console.log(reponse.result);
  })
  .catch((reponse) => {
    // Something went wrong
    console.log(reponse.statusMessage);
  });

};

Calls to a method on the client returns a Promise object

5.0.2

8 years ago

4.0.1

8 years ago

3.0.3

8 years ago

3.0.2

8 years ago

2.0.1

9 years ago

1.1.2

9 years ago