#!/usr/bin/env bash
#
# favicon - extract the icon of a given page using duckduckgo
# dependencies: chafa

url=$(echo "$1" | sed 's|https\?://||' | cut -d '/' -f1)
file="/tmp/favicon-${url}.ico"
wget -nv -O "${file}" "https://icons.duckduckgo.com/ip2/${url}.ico"
echo "${file}"
chafa "${file}"
