Skip to content

jschell12/shopsense-nodejs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

shopsense-nodejs - A nodejs interface for the ShopSense API

Description

This package provides an easy to use interface for the ShopStyle API commonly known as ShopSense. shopsense-nodejs makes it convenient to access the ShopStyle API from your nodejs application.

Installation

Install the nodejs package:

$ npm install shopsense-nodejs

Include it in you nodejs application:

var ss = require("shopsense");

Examples

var ShopSense = require("shopsense");

var pid = 'uid4384-22459372-1';
var apiVersion = 'v2';
var ss = new ShopSense(pid, apiVersion);

console.log(" ");
console.log("brands");
ss.brands().when(function(d){
    console.log(d.brands[0]);
});

console.log(" ");
console.log("categories");
ss.categories({
    cat: "mens-clothes",
    depth: "3"
}).when(function(d){
    console.log(d.categories[0]);
});

console.log(" ");
console.log("colors");
ss.colors().when(function(d){
    console.log(d.colors[0]);
});

console.log(" ");
console.log("product");
ss.product(359131344).when(function(d){
    console.log(d);
});

console.log(" ");
console.log("productSearch");
ss.productSearch({
    fts: "red dress",
    offset: "0",
    limit: "10"
}).when(function(d){
    console.log(d.products[0]);
});

console.log(" ");
console.log("productsHistogram");
ss.productsHistogram({
    filters: "Brand",
    floor: "0"
}).when(function(d){
    console.log(d.brandHistogram[0]);
});

console.log(" ");
console.log("retailers");
ss.retailers().when(function(d){
    console.log(d.retailers[0]);
});

Documentation

Will update this section or add some wiki pages when the package has been completed.

Bugs

Please report any bugs found in shopsense-nodejs here. I appreciate your help improving shopsense-nodejs

Contributing

To contribute to this project, please create a fork of this repository. Create thoughtfully named branches and submit pull requests into the "master" branch.

Getting started:

  • Clone your repository fork
  • cd into the directory
  • Run npm install to get all the dependencies
  • Run grunt nodeunit:all to make sure the unit tests pass
  • Hack away!
  • Write new unit tests if applicable
  • Make sure the unit tests pass before you open your pull-request (grunt nodeunit:all)

Suggestions

If you have suggestions please contact me at jschell12@gmail.com.

About

ShopSense API for nodejs.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published