~ihabunek/harvey

60f9ebcf80c5a43542f842584c762e5e38dd7028 — Ivan Habunek a month ago 79c236c
Fix categories for harvey norman
1 files changed, 9 insertions(+), 3 deletions(-)

M lib/harvey/providers/harvey_norman.ex
M lib/harvey/providers/harvey_norman.ex => lib/harvey/providers/harvey_norman.ex +9 -3
@@ 10,9 10,14 @@ defmodule Harvey.Providers.HarveyNorman do
    fridges_freezers: "https://www.harveynorman.hr/bijela-tehnika/hladnjaci-i-zamrzivaci",
    laptops: "https://www.harveynorman.hr/informatika/laptopi",
    monitors: "https://www.harveynorman.hr/informatika/racunalna-periferija/monitori",
    ovens:
      "https://www.harveynorman.hr/bijela-tehnika/pecnice-ugradbene-mikrovalne-pecnice-i-stednjaci",
    smartphones: "https://www.harveynorman.hr/mobiteli/smartphone",
    stoves: "https://www.harveynorman.hr/bijela-tehnika/ploce-za-kuhanje",
    tvs: "https://www.harveynorman.hr/audio-video/televizori",
    washers_dryers: "https://www.harveynorman.hr/bijela-tehnika/perilice-i-susilice-rublja"
    washers_dryers: "https://www.harveynorman.hr/bijela-tehnika/kombinirane-perilice-susilice",
    washers_dryers: "https://www.harveynorman.hr/bijela-tehnika/perilice-rublja",
    washers_dryers: "https://www.harveynorman.hr/bijela-tehnika/susilice-rublja"
  ]

  @impl Provider


@@ 29,8 34,9 @@ defmodule Harvey.Providers.HarveyNorman do

  @impl Provider
  def load_category(category) do
    url = Keyword.fetch!(@categories, category)
    do_load_category(url)
    @categories
    |> Keyword.get_values(category)
    |> Enum.flat_map(&do_load_category/1)
  end

  def do_load_category(url, scans \\ []) do