GithubHelp home page GithubHelp logo

ash-jc-allen / favicon-fetcher Goto Github PK

View Code? Open in Web Editor NEW
156.0 156.0 12.0 213 KB

A Laravel package for fetching favicons from websites.

License: MIT License

PHP 100.00%
hacktoberfest laravel php

favicon-fetcher's Introduction

Ash Allen - Laravel web developer

Hey, I'm Ash Allen! ๐Ÿ‘‹

I'm a freelance Laravel web developer from Preston, UK

  • ๐Ÿ’ฅ I build systems and websites for small businesses using Laravel.
  • ๐Ÿ“š I have a blog that focuses on helping other developers learn more about Laravel, PHP and web development.
  • ๐Ÿ–ฅ I have contributed to Laravel and other open-source projects.
  • ๐ŸŽ‰ I currently have 5 Laravel packages that are being used in commercial systems.
  • โœ๏ธ I write about Laravel, PHP and other web developments topics on the Ash Allen Design blog.
  • โœจ I wrote the FREE 70-page ebook called The Clean Coder's Guide to Laravel.
  • โšก I'm open to collaborating on other Laravel projects.
  • ๐Ÿฅ… 2022 Goal: Contribute to more open-source projects and write a new e-book.

I Write Guest Blog Posts

I Was Featured on Laravel News!

Languages and Tools

Laravel

Vue JS

HTML5

CSS3

Sass

JavaScript

SQL

MySQL

Git




โšก My Open Source Projects


๐Ÿ“˜ Some of My Blog Posts


codeSTACKr's Github Stats

favicon-fetcher's People

Contributors

ash-jc-allen avatar joedixon avatar marispro avatar mhoffmann-app avatar stylecibot avatar styxofdynamite avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

favicon-fetcher's Issues

How do we handle HTTP timeouts?

Hi, I'm using the http driver here for fetching favicon. When a favicon can't be retrieved, the HTTP driver seems to wait for a long time which is slowing down my front-end, any chance we can customise the timeout?

HttpDriver findLinkElement method

Hello,

currently findLinkElement() function pattern is
$pattern = '/<link.*rel="(icon|shortcut icon)"[^>]*>/i';

however this does not work in all cases, because it might assume that this is favicon link:

when we remove dot and asterisk (.*), then it works much better. However, I can not test all possible cases.
$pattern = '/<link rel="(icon|shortcut icon)"[^>]*>/i';

Any ideas why this pattern is how it is?

Call to a member function cache() on null

Hello,

If I run the following code which looks like it should work:

use AshAllenDesign\FaviconFetcher\Facades\Favicon;
Favicon::fetch("https://example.com/")->cache(now()->addWeek())->getFaviconUrl();

It will crash with:

[Error] Call to a member function cache() on null

How to handle cURL error 6: Could not resolve host

Hi! First of all, thanks for this great package.

I'm building service which handles 500k+ domains and there are many domains that are not available. When this happens, we will get cURL error for "Could not resolve host".

Any suggestions how to handle this error so that we will get favicon as null?

Thanks!

Wrong file extension when storing the favicon.

Hi thanks for this nice package, but I think there is a problem.
When storing the favicon in the storage I got this result :

$favicon = Favicon::fetch('https://headlessui.com')->store('favicons', 'public');
// 6f886546-edc2-4041-9a5c-8803f236ac25.com

$favicon = Favicon::fetch('https://vuejs.org')->store('favicons', 'public');
// favicons/bf4d32f3-fd86-4696-9a01-482d810da7f9.org

$favicon = Favicon::fetch('https://remote.io')->store('favicons', 'public');
// favicons/d0e9c6d4-2cd5-4abd-ac53-2fcad9ff817a.io

The file extension follows the URL domain. that's should not be the case, it should be .png or other image formats.

Doesn't handle urls that redirects to path

When the Uri provided to the Scan function responds with a 301 or 302 redirect, It's not working when the redirect location is a path.

Specifically, I'm having an issue where my local Jellyfin instance is at 192.168.x.x:x, but that address returns a 302 with a location of /web/index.html. The favicons are then publicly available at 192.168.x.x:x/web/asset.ico. However, the ScanResults will have a location of 192.168.x.x:x/asset.ico (missing the web path). The fetch is also returning null, which I believe has the same root issue.

Redirects seem to be handled correctly when it's a different domain (for example, https://youtu.be has some scan results for youtube.com).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.