GithubHelp home page GithubHelp logo

deto1986 / dm2telegraf Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 48 KB

Collect stock of different products of different dm stores around Bruchsal / Karlsruhe, Germany and return the information in a prettier json format to collect the information with telegraf

Dockerfile 7.94% JavaScript 92.06%

dm2telegraf's Introduction

DM2TELEGRAF

This service collect product stocks of different products for different dm stores using bbox coordinates to find the stores and return them in a pretty JSON format.

Use the environment parameters to configure the service:

Env Description Variable
DM4TELEGRAF_STORE_LOOKUP_URL Base URL to fetch store details via coordinates ${coords} map coordinates to find stores
DM4TELEGRAF_STORE_LOOKUP_COORDS Coordinates to fetch dm-Store IDs (comma separated for mulitple coordinates) -
DM4TELEGRAF_URL_PRODUCT_STOCK_PER_STORE Base URL to fetch stock availability for each product ID for each store ID ${product_ids}" comma-separated list for product id's you looking for; ${store_ids} comma-separated list for store id's you want to check the products
DM4TELEGRAF_URL_PRODUCT_IDS_TOILETPAPER Product IDs for toiletpaper (comma separated for mulitple) -
DM4TELEGRAF_URL_PRODUCT_IDS_MNS Product IDs for mouth-nose protective mask (comma separated for mulitple) -
DM4TELEGRAF_URL_PRODUCT_IDS_FFP2 Product IDs for masks with FFP2 standard (comma separated for mulitple) -
DM4TELEGRAF_DEBUG Enables or disables debug logging -

Find new product IDs

You can use the following web-service to search for products:

Replace ${searchterm} with a product name you like to search for.

The returned JSON contains items. The attribute "dan" contains the necessary product ID

Find coordinates for stores

You must use the dm-Website and open the store finder map, or use this url: https://www.dm.de/store

With the browser development tools you can use the network-tab to fetch the requests of the map. If you scrolling or zooming the map you notice request for https://store-data-service.services.dmtech.com/stores/bbox/. After /stores/bbox/ you can see the coordinates, copy these and set as DM4TELEGRAF_STORE_LOOKUP_COORDS env. You can comma separate different store coordinates to fetch data from multiple stores.

Example for Karlsruhe with a perimeter 20 km: https://store-data-service.services.dmtech.com/stores/bbox/49.12242304480293%2C7.948253206488602%2C48.92091530210405%2C8.793906256455102

Example for Bruchsal with a perimeter of 20 km: https://store-data-service.services.dmtech.com/stores/bbox/49.186565005019304%2C8.232638793807155%2C49.08604326652855%2C8.655465318790391

Get stock of product(s)

With web-service https://products.dm.de/store-availability/DE/availability?dans=${product_ids}&storeNumbers=${store_ids} you can request the available stock per store per product id.

You can comma-separate product id's and store id's to request multiple data at once.

dm2telegraf's People

Contributors

deto1986 avatar

Watchers

 avatar

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.