https://github.com/brianium/wallaby
Use the Walmart Open API from Clojure
https://github.com/brianium/wallaby
Last synced: about 1 year ago
JSON representation
Use the Walmart Open API from Clojure
- Host: GitHub
- URL: https://github.com/brianium/wallaby
- Owner: brianium
- License: epl-1.0
- Created: 2016-07-24T17:35:52.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-07-25T02:54:54.000Z (almost 10 years ago)
- Last Synced: 2025-03-18T05:56:28.049Z (about 1 year ago)
- Language: Clojure
- Size: 7.81 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
#wallaby
[](https://clojars.org/wallaby)
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
```clojure
(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`
```clojure
(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](http://www.http-kit.org/client.html)
There is currently one specialized function `product-lookup` which fills in the "items" api in the `request` function
```clojure
(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