Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API Refactoring #69

Merged
merged 15 commits into from
Feb 11, 2024
Merged

API Refactoring #69

merged 15 commits into from
Feb 11, 2024

Conversation

will-lumley
Copy link
Owner

This PR is HUGE and accomplishes the following:

  • a more developer friendly API
  • a much cleaner re-implementation of not only the FaviconFinder base class but also it's "finders"
  • a better implementation of the Linux-Swift code

Downloading a Favicon now looks like:

        let favicon = try await FaviconFinder(url: url)
            .fetchFaviconURLs()
            .download()
            .first()

Not one single FaviconURL is returned, but rather a whole array of ALL the favicons (for a specific source) that was found. This allows developers to inspect the favicon and to download them based on any particular properties they had.

Developers can now also view the "sizes" HTML/WebApplicationManifestFile property that websites state their icons have, in the sizeTag property.

If a developer wants the smallest or largest icon, they can easily call the following:

        let largest = try await FaviconFinder(url: url)
            .fetchFaviconURLs()
            .download()
            .largest()

        let smallest = try await FaviconFinder(url: url)
            .fetchFaviconURLs()
            .download()
            .smallest()

I'm hoping this API change is embraced, and if you have any questions or suggestions, I'm all ears!

@will-lumley will-lumley linked an issue Feb 11, 2024 that may be closed by this pull request
@will-lumley will-lumley merged commit 43934c5 into main Feb 11, 2024
3 checks passed
@will-lumley will-lumley deleted the tech/refactor branch February 11, 2024 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support sites with multiple favicon resolutions
1 participant