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.
Install the nodejs package:
$ npm install shopsense-nodejs
Include it in you nodejs application:
var ss = require("shopsense");
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]);
});
Will update this section or add some wiki pages when the package has been completed.
Please report any bugs found in shopsense-nodejs here. I appreciate your help improving shopsense-nodejs
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
)
If you have suggestions please contact me at jschell12@gmail.com.