A fork of the site-icons crate that's Sync (failed experiment)
This repository has been archived on 2025-01-30. You can view files and clone it, but cannot push or open issues or pull requests.
Find a file
2021-01-29 12:55:25 +00:00
src initial commit 2021-01-29 12:23:15 +00:00
.gitignore initial commit 2021-01-29 12:23:15 +00:00
.rustfmt.toml initial commit 2021-01-29 12:23:15 +00:00
Cargo.lock publish unpublished packages 2021-01-29 12:55:25 +00:00
Cargo.toml publish unpublished packages 2021-01-29 12:55:25 +00:00
Makefile.toml initial commit 2021-01-29 12:23:15 +00:00
README.md update readme 2021-01-29 12:24:05 +00:00

site_icons

An efficient website icon scraper for rust

use site_icons::Icons;

let icons = Icons::new();
// scrape the icons from a url
icons.load_website("https://github.com").await?;

// fetch all icons, ensuring they exist & determining size
let entries = icons.entries().await;
for icon in entries {
  println("{:?}", icon)
}

Features

  • Validates that all URLs exist and are actually images
  • Determines the size of the icon by partially fetching it
  • Supports WASM (and cloudflare workers)

Sources

  • HTML favicon tag (or looking for default /favicon.ico)
  • Web app manifest icons field
  • <img> tags on the page, directly inside the header OR with a src|alt|class containing the text "logo"

Running locally

Install cargo make and then:

cargo make run https://github.com