nerves-metal-detector / nerves_metal_detector

Find hardware supported by the Nerves Framework and where to buy it
https://nerves-metal-detector.org
MIT License
13 stars 3 forks source link

added in chicago elec dist #50

Closed bflatau closed 2 years ago

bflatau commented 2 years ago

Added in Chicago Elec. Dist.

PhillippOhlandt commented 2 years ago

The parsing looks good.

Two things:

  1. Could you change the vendor module name to ChicagoElectronicDistributorsUs (module and file names) but keep the shorter version for the vendor name field?

  2. Products that are in stock show a count on how many items are left, can you parse this as well? It's the same as for #30

Product that is on stock which has an items count: https://chicagodist.com/products/12-vdc-1000ma-regulated-switching-power-adapter-ul-listed

bflatau commented 2 years ago
  1. I changed the names, I hope that's what you were after?
  2. I implemented a stock counter. I'm sure there's a better, more "elixir way" to do the syntax...
    • I may be missing a potential error state, I'm only checking for != [] at the moment. I figure if I'm calling Floki, it will always spit out a list vs giving nil or some other value/data?
    • I'm not sure if I picked the right HTML element, but I liked that I could grab a direct value vs. doing some sort of text-to-number parsing function for the innerText since it contains both the number we want plus some text.
    • Let me know what you think!
PhillippOhlandt commented 2 years ago

Looks good to me! Thanks! closes #29