{"id":18270087,"url":"https://github.com/leonbreedt/FavIcon","last_synced_at":"2025-04-04T23:31:41.312Z","repository":{"id":56911208,"uuid":"44859776","full_name":"leonbreedt/FavIcon","owner":"leonbreedt","description":"Swift library to detect icons supported by a website. ","archived":true,"fork":false,"pushed_at":"2021-05-13T21:49:58.000Z","size":908,"stargazers_count":129,"open_issues_count":7,"forks_count":38,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-03-08T02:34:04.679Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/leonbreedt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-10-24T09:22:25.000Z","updated_at":"2025-01-20T15:23:54.000Z","dependencies_parsed_at":"2022-08-20T20:20:33.231Z","dependency_job_id":null,"html_url":"https://github.com/leonbreedt/FavIcon","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leonbreedt%2FFavIcon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leonbreedt%2FFavIcon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leonbreedt%2FFavIcon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leonbreedt%2FFavIcon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leonbreedt","download_url":"https://codeload.github.com/leonbreedt/FavIcon/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247266476,"owners_count":20910831,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-05T11:38:16.922Z","updated_at":"2025-04-04T23:31:40.850Z","avatar_url":"https://github.com/leonbreedt.png","language":"Swift","readme":"# FavIcon [![License](https://img.shields.io/badge/license-Apache%202.0-lightgrey.svg)](https://raw.githubusercontent.com/leonbreedt/FavIcon/main/LICENSE) [![Build Status](https://travis-ci.org/leonbreedt/FavIcon.svg)](https://travis-ci.org/leonbreedt/FavIcon) [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) ![Swift 5.0](https://img.shields.io/badge/Swift-5.0-orange.svg) ![platforms](https://img.shields.io/badge/platforms-iOS%20%7C%20macOS%20-lightgrey.svg)\n\n## Not actively maintained\n\nI am no longer able to spend as much time working on this library.\n\nYou may want to consider an using an alternative, such as\n[FavIconFinder](https://github.com/will-lumley/FaviconFinder), which is pure\nSwift and is more actively maintained.\n\n## What is this?\n\nFavIcon is a tiny Swift library for downloading the favicon representing a website.\n\nWait, why is a library needed to do this? Surely it's just a simple HTTP GET of\n`/favicon.ico`, right? Right?  Well. Go have a read of [this StackOverflow\npost](http://stackoverflow.com/questions/19029342/favicons-best-practices), and\nsee how you feel afterwards.\n\n## Quick Start\n\n### Swift Package Manager\n\nAdd it to your `Package.swift` as a dependency:\n\n```swift\n// swift-tools-version:5.0\nimport PackageDescription\n\nlet package = Package(\n    ...\n    dependencies: [\n        .package(url: \"https://github.com/leonbreedt/FavIcon.git\", from: \"3.1.0\"),\n    ],\n)\n```\n\n### CocoaPods\n\n*Note:* CocoaPods (1.4.0 or later) is required.\n\nAdd it to your `Podfile`:\n\n```ruby\nuse_frameworks!\npod 'FavIcon', '~\u003e 3.1.0'\n```\n\n### Carthage\n\nAdd it to your `Cartfile`:\n\n```ogdl\ngithub \"leonbreedt/FavIcon\" ~\u003e 3.1.0\n```\n\n## Features\n- Detection of `/favicon.ico` if it exists\n- Parsing of the HTML at a URL, and scanning for appropriate `\u003clink\u003e` or\n  `\u003cmeta\u003e` tags that refer to icons using Apple, Google or Microsoft\n  conventions.\n- Discovery of and parsing of Web Application manifest JSON files to obtain\n  lists of icons.\n- Discovery of and parsing of Microsoft browser configuration XML files for\n  obtaining lists of icons.\n\nYup. These are all potential ways of indicating that your website has an icon\nthat can be used in user interfaces. Good work, fellow programmers. 👍\n\n## Usage Example\nPerhaps you have a location in your user interface where you want to put\nthe icon of a website the user is currently visiting?\n\n```swift\ntry FavIcon.downloadPreferred(\"https://apple.com\") { result in\n    if case let .success(image) = result {\n      // On iOS, this is a UIImage, do something with it here.\n      // This closure will be executed on the main queue, so it's safe to touch\n      // the UI here.\n    }\n}\n```\n\nThis will detect all of the available icons at the URL, and if it is able to\ndetermine their sizes, it will try to find the icon closest in size to your\ndesired size, otherwise, it will prefer the largest icon. If it has no idea of\nthe size of any of the icons, it will prefer the first one it found.\n\nOf course, if this approach is too opaque for you, you can download them all\nusing `downloadAll(url:completion:)`.\n\nOr perhaps you’d like to take a stab at downloading them yourself at a later\ntime, choosing which icon you prefer based on your own criteria, in which case\n`scan(url:completion:)` will give you information about the detected icons, which\nyou can feed to `download(url:completion:)` for downloading at your convenience.\n\n\n## Example Project\n\nSee the iOS project in `Example/` for a simple example of how to use the library.\n\n## License\n\nApache 2.0\n\n","funding_links":[],"categories":["etc"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleonbreedt%2FFavIcon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleonbreedt%2FFavIcon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleonbreedt%2FFavIcon/lists"}