Help us shape the future of Go! Take the 2026 Go Developer Survey

loadfavicon

command module
v1.2.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 10, 2022 License: MIT Imports: 4 Imported by: 0

README

loadfavicon

loadfavicon get and download all favicons of given websites, written in go.

Features

  • look up all favicons referenced in the of a website, plus the favicon.ico file itself at the root of the website
  • returns only valid image files and urls. removes duplicates
  • sluggify website names to make a valid disk filename (eg. to put them in cache for example)
  • get all favicons or only a single one according to choosen options

Install

go install github.com/lolorenzo777/loadfavicon

Requests or bugs?

https://github.com/lolorenzo777/loadfavicon/issues

Licence

Copyright @lolorenzo777 - 2022 May

MIT Licence

References

Documentation

Overview

loadfavicon command download all favicons of given websites, written in go.

loadfavicon <website> <destination_directory> [--single]

Set the flags [--single] to select and download only one favicon if severals have been found.

Examples

Some example to run the favicon command

# https://go.dev has a single favicon file, an .ico, download it into ./myfavicons dir
# ./myfavicons will be created if does not exists
$ loadfavicon https://go.dev ./myfavicons

# https://www.docker.com/ has multiple icons, download all
$ loadfavicon https://www.docker.com/ ./myfavicons

# https://github.com has multiple icons, download the best one
$ loadfavicon https://github.com ./myfavicons --single

Then your “./myfavicons“ dir should looks like this:

  • ./
  • ../
  • github-com+pinned-octocat.svg
  • go-dev+favicon.ico
  • www-docker-com+cropped-Docker-R-Logo-08-2018-Monochomatic-RGB_Moby-x1-180x180.png
  • www-docker-com+cropped-Docker-R-Logo-08-2018-Monochomatic-RGB_Moby-x1-192x192.png
  • www-docker-com+cropped-Docker-R-Logo-08-2018-Monochomatic-RGB_Moby-x1-32x32.png
  • www-docker-com+favicon.ico

Install

Since Go 1.16 downloading and installing a go programs is very simple:

go install github.com/lolorenzo777/loadfavicon

Directories

Path Synopsis
getfavicon package get and download all favicons of given websites.
getfavicon package get and download all favicons of given websites.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL