# `FindSiteIcon`
[🔗](https://github.com/XukuLLC/find_site_icon/blob/v1.0.2/lib/find_site_icon.ex#L1)

Finds the large square icon for a site given its URL.

# `find_icon_option`

```elixir
@type find_icon_option() ::
  {:default_icon_url, binary()}
  | {:html, binary()}
  | {:http_options, keyword()}
  | {:max_concurrency, pos_integer()}
  | {:max_icons, pos_integer() | :infinity}
  | {:pool_max_idle_time, pos_integer() | :infinity}
  | {:timeout, timeout()}
```

# `find_icon`

```elixir
@spec find_icon(binary(), [find_icon_option()]) ::
  {:error, binary()} | {:ok, binary()}
```

Finds the large square icon for a site given its URL.

Can be provided with additional options in the second argument:
* :html -> can pass an already fetched html. Will look for icon link tags within the provided
html if present.
* :default_icon_url -> is used if no icon_url could be fetched.
* :timeout -> caps the whole icon lookup and applies the same timeout to HTTP requests.
* :http_options -> passes Req options to the internal HTTP client.
* :max_concurrency -> limits concurrent icon probes. Defaults to 8.
* :max_icons -> limits how many candidate icon URLs will be probed. Defaults to no limit.
* :pool_max_idle_time -> milliseconds before idle Finch socket pools are terminated so
file descriptors are reclaimed when probing many distinct hosts. Defaults to 30_000.
Pass `:infinity` to restore Req's pre-1.0.2 behaviour of keeping pools alive forever.

## Examples

    iex> FindSiteIcon.find_icon("https://nytimes.com")
    {:ok, "https://nytimes.com/vi-assets/static-assets/ios-ipad-144x144-28865b72953380a40aa43318108876cb.png"}

---

*Consult [api-reference.md](api-reference.md) for complete listing*
