Skip to content

brianium/wallaby

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#wallaby

Clojars Project

A Clojure library designed to simplify working with the Walmart Open API

Installation

Add the following dependency to your project.clj file:

[wallaby "0.2.0"]

Usage

(ns my-walmart.app
  (:require [wallaby.core :refer :all]))

;; Product Lookup Operation
(def result (product-lookup {:apiKey "my-api-key"
                             :upc    "035000521019"}))

;; results are futures containing response as a map
(def realized @result);

Functions

The main function is request. All functions are a specialization of this function.

request

(defn request
  ([api params config] ,,,)
  ([api params] (request api params {})))
  • api is a string representing the Walmart API of interest - i.e "items"
  • params is a map that will be converted straight to query params
  • config is an optional map that gets fed right to http-kit

There is currently one specialized function product-lookup which fills in the "items" api in the request function

(defn product-lookup
  ([params config] (request "items" params config))
  ([params] (requeset "items" params)))

request has a single pre-condition defined to ensure the presence of the :apiKey key on the params map.

License

Copyright © 2016 Brian Scaturro

Distributed under the Eclipse Public License, the same as Clojure

About

Use the Walmart Open API from Clojure

Resources

License

Stars

Watchers

Forks

Packages

No packages published