Skip to content

ncloudioj/iconic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status Hex pm

Iconic

Fetch icon links from sites like a breeze. It supports "icon", "shortcut icon", "apple-touch-icon", "apple-touch-icon-precomposed", "fluid-icon", and "mask-icon".

Usage

# get icons from one site
iex> Iconic.get("https://elixir-lang.org")

[%Icon.Parse.Icon{href: "https://elixir-lang.org/favicon.ico",
  rel: "shortcut icon", sizes: nil, type: "image/x-icon"}]

# get icons from multiple sites concurrently
iex> Enum.to_list(Iconic.mget(
["https://elixir-lang.org", "news.ycombinator.com", "https://www.reddit.com"]))

[ok: [%Icon.Parse.Icon{href: "https://elixir-lang.org/favicon.ico",
   rel: "shortcut icon", sizes: nil, type: "image/x-icon"}],
 ok: [%Icon.Parse.Icon{href: "http://news.ycombinator.comfavicon.ico",
   rel: "shortcut icon", sizes: nil, type: nil}],
 ok: [%Icon.Parse.Icon{href: "http://www.redditstatic.com/icon.png",
   rel: "icon", sizes: "256x256", type: "image/png"},
  %Icon.Parse.Icon{href: "http://www.redditstatic.com/favicon.ico",
   rel: "shortcut icon", sizes: nil, type: "image/x-icon"},
  %Icon.Parse.Icon{href: "http://www.redditstatic.com/icon-touch.png",
   rel: "apple-touch-icon-precomposed", sizes: nil, type: nil}]]

# with control options (timeout and max concurrency)
iex> Enum.to_list(Iconic.mget(
["https://elixir-lang.org", "news.ycombinator.com", "https://www.reddit.com"],
[max_concurrency: 16, timeout: 30000]))


Installation

The package can be installed by adding iconic to your list of dependencies in mix.exs:

def deps do
  [
    {:iconic, "~> 0.1.1"}
  ]
end

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/iconic.

License

Apache 2.0

About

Combine harvester for favicons

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages