0.1.1 • Published 10 years ago

shoper-pl v0.1.1

Weekly downloads
4
License
ISC
Repository
github
Last release
10 years ago

Shoper API in node.js

API reference

API do serwisu Shoper.pl oraz ClickShop napisane w node.js z użyciem request oraz promises Q.

Większość funkcji działa na promisach. Moduł zawiera tylko kilka funkcji, ale rozszerzenie go jest proste - wystarczy dopisać kolejną funkcję na podstawie istniejących. Należy zwrócić uwagę na nazwy argumentów przekazywane w obiekcie options do każdego wywołania. Szczegóły w kodzie oraz dokumentacji API shopera.

Konfiguracja odbywa poprzez plik settings.json

Przykład w example.js


There is a rewrite taking place to make all functions promise-based. This is work in progress implementing only a handful of functions. But extending it is very easy - just read the API docs and write another method based upon the existing ones - simply create a proper argument object and pass it to apiCall. Use at your own risk.

Configuration is done in settings.json

EXAMPLE

require('shoper-pl')
    .loginQ()

    .then(function (){
        var options  = {
            "extended" : true,
            "translations" : true,
            "options" : false,
            "gfx" : false,
            "attributes" : true,
            "products" : [30995]
        };
      return api.product_list(options)
    })

    .then(function(productList){
      // do something with productList
      var options = {
        conditions : {"category.category_id" :  90}
      };
      return api.product.list.filter(options)
    })

    .then(function(productList){
      // do something with results
      var options = {
        "id" : 184,
        "data" : [],
        "force" : true
      };
      return api.product.attributes.save(options)
    })

    .then(function(result){
      console.log(result)
    })

    .done(); // end promise chain

See example.js

0.1.1

10 years ago

0.1.0

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago