#favicon #logo #website #scraper #cli

nightly bin+lib repo_icons

Get icons for any github repo

13 releases

0.1.13 Jul 24, 2022
0.1.12 Jul 24, 2022
0.1.11 May 4, 2022
0.1.7 Apr 15, 2022
0.1.1 Feb 4, 2021

#247 in Images

Download history 7/week @ 2022-04-21 112/week @ 2022-04-28 110/week @ 2022-05-05 187/week @ 2022-05-12 57/week @ 2022-05-19 53/week @ 2022-05-26 105/week @ 2022-06-02 14/week @ 2022-06-09 6/week @ 2022-06-16 13/week @ 2022-06-23 17/week @ 2022-06-30 15/week @ 2022-07-07 14/week @ 2022-07-14 80/week @ 2022-07-21 23/week @ 2022-07-28 33/week @ 2022-08-04

163 downloads per month
Used in git-icons

GPL-3.0 license

645KB
970 lines

repo_icons

Crates.io Documentation GitHub Sponsors

An API / Rust Library / CLI to get icons for any GitHub repo. Try it out

API screenshot

Features

  • Super fast!
  • Partially downloads images to find the sizes
  • Extracts images from the repo's homepage using site_icons
  • Supports WASM (and cloudflare workers)

CLI

You can test it out locally, by downloading & running the CLI:

cargo install repo_icons

repo-icons facebook/react
# data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9Ii0xMS41IC0xMC4yMzE3NCAyMyAyMC40NjM0OCI+CiAgPHRpdGxlPlJlYWN0IExvZ288L3RpdGxlPgogIDxjaXJjbGUgY3g9IjAiIGN5PSIwIiByPSIyLjA1IiBmaWxsPSIjNjFkYWZiIi8+CiAgPGcgc3Ryb2tlPSIjNjFkYWZiIiBzdHJva2Utd2lkdGg9IjEiIGZpbGw9Im5vbmUiPgogICAgPGVsbGlwc2Ugcng9IjExIiByeT0iNC4yIi8+CiAgICA8ZWxsaXBzZSByeD0iMTEiIHJ5PSI0LjIiIHRyYW5zZm9ybT0icm90YXRlKDYwKSIvPgogICAgPGVsbGlwc2Ugcng9IjExIiByeT0iNC4yIiB0cmFuc2Zvcm09InJvdGF0ZSgxMjApIi8+CiAgPC9nPgo8L3N2Zz4K site_logo svg
# https://reactjs.org/icons/icon-512x512.png?v=f4d46f030265b4c48a05c999b8d93791 app_icon png 512x512
# https://reactjs.org/icons/icon-384x384.png?v=f4d46f030265b4c48a05c999b8d93791 app_icon png 384x384

Rust usage

use repo_icons::RepoIcons;

let icons = RepoIcons::load("facebook", "react").await?;

for icon in icons {
  println("{:?}", icon)
}

Deploying to Cloudflare Workers

Clone this repo locally, and then:

cd api
wrangler publish

Running locally

Install cargo make and then:

# to run cli
cargo make run facebook/react

# or to run the API devserver
cd api
cargo make run

Dependencies

~12–22MB
~446K SLoC