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);
-
Notifications
You must be signed in to change notification settings - Fork 0
1up-lab/favicon-fetcher
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Packages 0
No packages published