ammocpr/lib/ammoprices/scraping/scraper.ex
Graham McIntire 9eb85faebd
Add 4 new retailer scrapers for broader price coverage
Add True Shot Ammo (Shopify JSON), Palmetto State Armory (Magento HTML),
Bulk Ammo (Magento HTML), and Natchez Shooters Supply (GraphQL API).

Extends scraper infrastructure with HttpClient.post_json/3 and an
optional fetch/2 callback on the Scraper behaviour for scrapers that
need custom HTTP flows (e.g. GraphQL POST requests).
2026-03-12 10:00:59 -05:00

10 lines
350 B
Elixir

defmodule Ammoprices.Scraping.Scraper do
@moduledoc false
@callback retailer_slug() :: String.t()
@callback category_url(caliber :: map()) :: String.t() | nil
@callback parse_products(html :: term()) :: [map()]
@callback fetch(retailer :: map(), caliber :: map()) :: {:ok, [map()]} | {:error, term()}
@optional_callbacks [fetch: 2]
end