Skip to content

Commit

Permalink
feat: request stock numbers for products/country/stores
Browse files Browse the repository at this point in the history
  • Loading branch information
Ephigenia committed Feb 2, 2017
1 parent 0609594 commit ed41c92
Show file tree
Hide file tree
Showing 14 changed files with 224 additions and 2,484 deletions.
71 changes: 9 additions & 62 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,67 +1,14 @@
*WIP*
Sometimes there is a high demand on products which then are unavailable in the IKEA online store and even in the locations. So here’s a script which makes it easy to check the availability of a list of products and locations.

## List Stock numbers for specific product & store
[![CircleCI](https://circleci.com/gh/Ephigenia/ikea-availability-checker.svg?style=svg&circle-token=1907356b3e852337a9e5f96d9b99ef1942c4ffa2)](https://circleci.com/gh/Ephigenia/ikea-availability-checker)
[![Code Climate](https://codeclimate.com/repos/58920ec367bbb4005e0076bf/badges/e41dd44da970110ab426/gpa.svg)](https://codeclimate.com/repos/58920ec367bbb4005e0076bf/feed)
[![Issue Count](https://codeclimate.com/repos/58920ec367bbb4005e0076bf/badges/e41dd44da970110ab426/issue_count.svg)](https://codeclimate.com/repos/58920ec367bbb4005e0076bf/feed)
[![Test Coverage](https://codeclimate.com/repos/58920ec367bbb4005e0076bf/badges/e41dd44da970110ab426/coverage.svg)](https://codeclimate.com/repos/58920ec367bbb4005e0076bf/coverage)

cli.js --store=018 S49903093
# Installation

## List Stock for multiple products & stores
npm install ikea-availability-checker

cli.js --store=018,005,147 S49903093,60205918,90205912
# Topics






*OLD TEXT*

Related Articles
https://medium.com/@JoshuaAJung/api-of-the-day-ikea-availability-checks-8678794a9b52#.f5uh9iht8

Sometimes there is a high demand on products which then are unavailable in the IKEA online store and even in the locations. So here’s a script which makes it easy to check the availability of a list of products and locations. The results are printed out in the command line like this:


```
60205918 KROKTORP Schubladenfront 60x40 elfenbeinweiss
┌────────────────────┬───────┬─────────────┐
│ Location │ Stock │ Probability │
├────────────────────┼───────┼─────────────┤
│ Berlin Woltersdorf │ 0 │ LOW │
├────────────────────┼───────┼─────────────┤
│ Berlin Lichtenberg │ 9 │ MEDIUM │
├────────────────────┼───────┼─────────────┤
│ Berlin Tempelhof │ 0 │ LOW │
└────────────────────┴───────┴─────────────┘
60205918 KROKTORP Schubladenfront 60x40 elfenbeinweiss
┌────────────────────┬───────┬─────────────┐
│ Location │ Stock │ Probability │
├────────────────────┼───────┼─────────────┤
│ Berlin Woltersdorf │ 22 │ HIGH │
├────────────────────┼───────┼─────────────┤
│ Berlin Lichtenberg │ 0 │ LOW │
├────────────────────┼───────┼─────────────┤
│ Berlin Tempelhof │ 0 │ LOW │
└────────────────────┴───────┴─────────────┘
```

## How it works

The script iterates over a (for now) fixed list of product ids and scrapes the availability service of IKEA germany to check the in-store stock for those items. After that it searches for a fixed list of location ids (for now only 4 of them in Berlin) and prints the results in a table per product.

## Usage

coffee index [country-code]

List available country codes

coffee index help

## Ideas

- [x] include all Germany IKEA Location ids
- [ ] include other countries like Austria (just with `at/de` instead of `de/de` in the uri)
- [ ] find out why some product ids need a "S" in front
- [ ] find out which errors could occor or if there are limits
- [ ] web interface instead of cli
- [ ] variable list of products
- [ ] one kind of notification (e-mail)
* [stock examples](docs/stock.md)
45 changes: 45 additions & 0 deletions docs/stock.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Specific product, store & country

source/cli.js stock --store=155 --country=at S49903093

```
┌─────────┬───────────┬──────────────────┬───────┬─────────────┐
│ country │ product │ storeId (buCode) │ stock │ probability │
├─────────┼───────────┼──────────────────┼───────┼─────────────┤
│ at │ S49903093 │ 155 │ 0 │ HIGH │
└─────────┴───────────┴──────────────────┴───────┴─────────────┘
```

# Multiple products & stores

source/cli.js stock --country=de --store=224,069,063 S49903093 40313075 40299687

```
┌─────────┬───────────┬──────────────────┬───────┬─────────────┐
│ country │ product │ storeId (buCode) │ stock │ probability │
├─────────┼───────────┼──────────────────┼───────┼─────────────┤
│ de │ S49903093 │ 063 │ 0 │ HIGH │
├─────────┼───────────┼──────────────────┼───────┼─────────────┤
│ de │ S49903093 │ 069 │ 4 │ HIGH │
├─────────┼───────────┼──────────────────┼───────┼─────────────┤
│ de │ S49903093 │ 224 │ 0 │ HIGH │
└─────────┴───────────┴──────────────────┴───────┴─────────────┘
┌─────────┬──────────┬──────────────────┬───────┬─────────────┐
│ country │ product │ storeId (buCode) │ stock │ probability │
├─────────┼──────────┼──────────────────┼───────┼─────────────┤
│ de │ 40313075 │ 063 │ 10 │ HIGH │
├─────────┼──────────┼──────────────────┼───────┼─────────────┤
│ de │ 40313075 │ 069 │ 6 │ HIGH │
├─────────┼──────────┼──────────────────┼───────┼─────────────┤
│ de │ 40313075 │ 224 │ 10 │ HIGH │
└─────────┴──────────┴──────────────────┴───────┴─────────────┘
┌─────────┬──────────┬──────────────────┬───────┬─────────────┐
│ country │ product │ storeId (buCode) │ stock │ probability │
├─────────┼──────────┼──────────────────┼───────┼─────────────┤
│ de │ 40299687 │ 063 │ 22 │ HIGH │
├─────────┼──────────┼──────────────────┼───────┼─────────────┤
│ de │ 40299687 │ 069 │ 33 │ HIGH │
├─────────┼──────────┼──────────────────┼───────┼─────────────┤
│ de │ 40299687 │ 224 │ 45 │ HIGH │
└─────────┴──────────┴──────────────────┴───────┴─────────────┘
```
37 changes: 0 additions & 37 deletions old/buCodes.js

This file was deleted.

143 changes: 0 additions & 143 deletions old/country.js

This file was deleted.

Loading

0 comments on commit ed41c92

Please sign in to comment.