GithubHelp home page GithubHelp logo

tcarlock / shopsense-nodejs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jschell12/shopsense-nodejs

0.0 1.0 0.0 7.11 MB

ShopSense API for nodejs.

License: MIT License

JavaScript 100.00%

shopsense-nodejs's Introduction

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 request = require('request');

var httpClient = function(url, future){
    request.get({url:url, json:true}, function (e, r, d) {
        future.deliver(d);
    });
};

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

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 [email protected].

shopsense-nodejs's People

Contributors

jschell12 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.