Skip to content
This repository has been archived by the owner on Apr 12, 2023. It is now read-only.
/ favicon-getter Public archive

Simple flask app to retrieve and display a website's favicon. It is more complex than you think!

Notifications You must be signed in to change notification settings

curabase/favicon-getter

Repository files navigation

No longer maintained

This was a fun experiment, and I used it for a long time on some side projects. But the time has come to put this into archive mode and call it a day.

There is a good one available here: https://github.com/mat/besticon

About this project

I often build dashboards and consoles that link to outside websites, and it is a nice UX perk to see the site's favicon next to the link. As it turns out, not all websites publish their favicon at example.com/favicon.ico, which results in 404 and broken images. I made this little api and script to automatically hunt-down that favicon, and as a last resort, generate one.

Features

  • All favicons are stored/cached locally, so you only pay the download penalty once. You can warm-up your cache with a list of domains and a shell script to curl those domains to the favicon API

  • Icon generated if there really is no favicon to be found for that domain

API Endpoints

There is only one endpoint. http://localhost:8000/?url=example.com

Parameters

  • url: the url of the web page you want the favicon from

Getting started (development)

This is a really simple app to get started with.

  1. git clone git@bitbucket.org:bkmk/favicon-getter.git
  2. cp docker-compose.sample.yml docker-compose.yml
  3. cp Makefile.sample Makefile
  4. cp env.sample env env.prod (one for local and prod if that is your thing)
  5. edit HOST in Makefile of your live endpoint
  6. check the docker-compose.yml settings (I have some traefik stuff in there)

Personally, I like JetBrain's PyCharm Professional to work in a full debugged environment.

Deploying to production

I use docker-compose. See the samples.

Other favicon grabbers

About

Simple flask app to retrieve and display a website's favicon. It is more complex than you think!

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published