Skip to content

bonfire-networks/faviconic

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Faviconic

Fetch a favicon from a URL, with multiple fallbacks.

Full online documentation is available here.

You can find the package on Hex here.

For example.com it will first try example.com/favicon.ico, then it will try to find the icon file path in the HTML, and if it does. If both fail, then it will try getting an icon from Duckduckgo and Google.

To use

case Faviconic.fetch("google.com") do
  {:ok, image} -> image # image itself is returned
  {:error, error_message} -> IO.inspect(error_message)
end
case Faviconic.get("google.com") do
  {:ok, url} -> url # icon URL is returned
  {:error, error_message} -> IO.inspect(error_message)
end

MIT License

Copyright 2022 Bonfire Networks

Copyright 2018 Zak Miller (author of the library Faviconic was forked from: https://github.com/ZakMiller/fetch-favicon)

About

Fetch Favicons with multiple fallbacks.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Elixir 99.7%
  • Shell 0.3%