Giter Club home page Giter Club logo

supreme-api's Introduction

Supreme API

A NodeJS API for supremenewyork.com

NPM

How to install

npm install supreme-api --save

Check out the docs!

Usage

const supreme = require('supreme-api');

supreme.getItems('all', (items, err) => {
    if (err) {
        console.log(err);
        return err;
    }
    console.log(items);
});

supreme.getItem('http://www.supremenewyork.com/shop/jackets/fman5r0xy/aw5dopam2', (item, err) => {
    if (err) {
        console.log(err);
        return err;
    }
    console.log(item);
});

// check every 5 seconds
supreme.watchAllItems(5, 'shoes', (items, err) => {
    if (err) {
        console.log(err);
        return err;
    }
    console.log(items);
});

// Cancel Item watch
supreme.stopWatchingAllItems((status, err) => {
    if (err) {
        console.log(err);
        return err;
    }
    console.log(status);
});

// Look for a new item every 5 seconds
supreme.onNewItem(5, (product, err) => {
    if (err) {
        console.log(err);
        return err;
    }
    console.log('New Release: ' + item.name);
});

// Find items based on specific keywords

const category = 'jackets';
const keywords = "UNDERCOVER";
const style = 'Burgundy';

supreme.seek(category, keywords, style, (product, err) => {
    if (err) {
        console.log(err);
        return err;
    }
    console.log(product);
    console.log(product.title); // example => Supreme®/UNDERCOVER Wool Overcoat
});

Future of this project

  • Watch and seek for changes on individual items. (Coming Soon)

Contribution

Want to make a contribution? Fork the repo, add your changes, and submit a pull request. Any type of contributions (ideas, bug fixes, fixing typos, etc.) will be appreciated!

License

supreme-api is licensed under MIT License.

supreme-api's People

Contributors

dzt avatar phineas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

supreme-api's Issues

TypeError: callback is not a function

Hello When trying to call the watch for new items this pops out.

supreme.onNewItem(5, (product, err) => {
if (err) {
console.log(err);
return err;
}
console.log('New Release: ' + item.name);
});

TypeError: callback is not a function
/node_modules/supreme-api/index.js:227:13
at Request._callback /node_modules/supreme-api/index.js:52:22)
at Request.self.callback
node_modules/request/request.js:188:22)
at emitTwo (events.js:106:13)
at Request.emit (events.js:191:7)
at Request.
node_modules/request/request.js:1171:10)
at emitOne (events.js:96:13)
at Request.emit (events.js:188:7)
at IncomingMessage.
node_modules/request/request.js:1091:12)
at IncomingMessage.g (events.js:292:16)

Thanks for the awsom api 👍

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.