oneup/favicon-fetcher

List and download favicons from urls

Maintainers

👁 sheeep

Package info

github.com/1up-lab/favicon-fetcher

pkg:composer/oneup/favicon-fetcher

Statistics

Installs: 1 694

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

1.0.0 2024-02-23 15:14 UTC

Requires

Requires (Dev)

Suggests

None

Provides

None

Conflicts

None

Replaces

None

MIT 544ebe31ddcf7ebdee5f1f7c881a49bf72573833

favicons

This package is auto-updated.

Last update: 2026-06-23 20:20:00 UTC


README

use Oneup\FaviconFetcher\FaviconFetcher;
use Oneup\FaviconFetcher\SizeParser;
use Oneup\FaviconFetcher\Strategy\RelIconStrategy;
use Oneup\FaviconFetcher\Strategy\AppleTouchIconStrategy;
use Oneup\FaviconFetcher\UrlNormalizer;

$httpClient = ...

$sizeParser = new SizeParser();
$urlNormalizer = new UrlNormalizer();

$faviconFetcher = new FaviconFetcher($httpClient, [
 new RelIconStrategy($sizeParser, $urlNormalizer),
 new AppleTouchIconStrategy($sizeParser, $urlNormalizer),
]);

$collection = $faviconFetcher->fetch('https://1up.io');
$favicon = $collection->findOneByMinimumSize(32, 32);

$contents = $faviconFetcher->download($favicon);