diff --git a/.github/dependabot.yml b/.github/dependabot.yml
new file mode 100644
index 0000000..c4969be
--- /dev/null
+++ b/.github/dependabot.yml
@@ -0,0 +1,9 @@
+# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
+
+version: 2
+updates:
+ - package-ecosystem: cargo
+ directory: "/"
+ schedule:
+ interval: weekly
+ day: friday
diff --git a/.github/exporter.sh b/.github/exporter.sh
deleted file mode 100755
index 270990e..0000000
--- a/.github/exporter.sh
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/usr/bin/env bash
-
-set -euo pipefail
-
-URL="https://exporter.akerl.app/metric"
-AUTH="Authorization: Bearer $EXPORTER_TOKEN"
-if [[ "$JOB_STATUS" == "success" ]] ; then
- VALUE=1
-else
- VALUE=0
-fi
-BODY="{\"name\":\"gh/${GITHUB_REPOSITORY}\",\"metrics\":[{\"name\":\"ghactions\",\"type\":\"gauge\",\"tags\":{\"repo\":\"${GITHUB_REPOSITORY}\"},\"value\":\"${VALUE}\"}]}"
-
-echo "$BODY"
-
-curl -i -XPOST -d "$BODY" -H"$AUTH" "$URL"
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
deleted file mode 100644
index 82ff923..0000000
--- a/.github/workflows/build.yml
+++ /dev/null
@@ -1,37 +0,0 @@
----
-name: Build
-'on':
- push:
- branches:
- - main
- tags:
- - "**"
- pull_request_target:
-jobs:
- build:
- name: Build
- runs-on: ubuntu-22.04
- permissions:
- contents: write
- steps:
- - name: Checkout
- uses: actions/checkout@v3
- with:
- submodules: recursive
- - uses: ruby/setup-ruby@v1
- with:
- ruby-version: '3.1'
- bundler-cache: true
- - name: Build
- run: bundle exec rake
- - name: Release
- if: github.ref_type == 'tag'
- run: bundle exec rake release
- env:
- GEM_HOST_API_KEY: "${{ secrets.GEM_HOST_API_KEY }}"
- - name: Post to hook-exporter
- run: "./.github/exporter.sh"
- env:
- EXPORTER_TOKEN: "${{ secrets.EXPORTER_TOKEN }}"
- JOB_STATUS: "${{ job.status }}"
- if: always() && github.ref == 'refs/heads/main'
diff --git a/.gitignore b/.gitignore
index 68ca1c3..105fc88 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,3 @@
-pkg/*.gem
-coverage/
-.coveralls.yml
-.bundle
-Gemfile.lock
+target/
+.DS_Store
+*.svg
diff --git a/.rspec b/.rspec
deleted file mode 100644
index b7afd2d..0000000
--- a/.rspec
+++ /dev/null
@@ -1,2 +0,0 @@
---format Fuubar
---color
diff --git a/.rubocop.yml b/.rubocop.yml
deleted file mode 100644
index 4814744..0000000
--- a/.rubocop.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-inherit_gem:
- goodcop: .rubocop.yml
diff --git a/Cargo.lock b/Cargo.lock
new file mode 100644
index 0000000..dce1c9c
--- /dev/null
+++ b/Cargo.lock
@@ -0,0 +1,1876 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+version = 3
+
+[[package]]
+name = "addr2line"
+version = "0.24.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1"
+dependencies = [
+ "gimli",
+]
+
+[[package]]
+name = "adler2"
+version = "2.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627"
+
+[[package]]
+name = "ahash"
+version = "0.8.11"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011"
+dependencies = [
+ "cfg-if",
+ "getrandom",
+ "once_cell",
+ "version_check",
+ "zerocopy",
+]
+
+[[package]]
+name = "aho-corasick"
+version = "1.1.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916"
+dependencies = [
+ "memchr",
+]
+
+[[package]]
+name = "autocfg"
+version = "1.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26"
+
+[[package]]
+name = "backtrace"
+version = "0.3.74"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a"
+dependencies = [
+ "addr2line",
+ "cfg-if",
+ "libc",
+ "miniz_oxide",
+ "object",
+ "rustc-demangle",
+ "windows-targets 0.52.6",
+]
+
+[[package]]
+name = "base64"
+version = "0.21.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567"
+
+[[package]]
+name = "bitflags"
+version = "1.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
+
+[[package]]
+name = "bitflags"
+version = "2.6.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de"
+
+[[package]]
+name = "bumpalo"
+version = "3.16.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c"
+
+[[package]]
+name = "byteorder"
+version = "1.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b"
+
+[[package]]
+name = "bytes"
+version = "1.8.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da"
+
+[[package]]
+name = "cc"
+version = "1.1.37"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "40545c26d092346d8a8dab71ee48e7685a7a9cba76e634790c215b41a4a7b4cf"
+dependencies = [
+ "shlex",
+]
+
+[[package]]
+name = "cfg-if"
+version = "1.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
+
+[[package]]
+name = "core-foundation"
+version = "0.9.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f"
+dependencies = [
+ "core-foundation-sys",
+ "libc",
+]
+
+[[package]]
+name = "core-foundation-sys"
+version = "0.8.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b"
+
+[[package]]
+name = "cssparser"
+version = "0.31.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5b3df4f93e5fbbe73ec01ec8d3f68bba73107993a5b1e7519273c32db9b0d5be"
+dependencies = [
+ "cssparser-macros",
+ "dtoa-short",
+ "itoa",
+ "phf 0.11.2",
+ "smallvec",
+]
+
+[[package]]
+name = "cssparser-macros"
+version = "0.6.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "13b588ba4ac1a99f7f2964d24b3d896ddc6bf847ee3855dbd4366f058cfcd331"
+dependencies = [
+ "quote",
+ "syn 2.0.87",
+]
+
+[[package]]
+name = "derive_more"
+version = "0.99.18"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.87",
+]
+
+[[package]]
+name = "displaydoc"
+version = "0.2.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.87",
+]
+
+[[package]]
+name = "dtoa"
+version = "1.0.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "dcbb2bf8e87535c23f7a8a321e364ce21462d0ff10cb6407820e8e96dfff6653"
+
+[[package]]
+name = "dtoa-short"
+version = "0.3.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cd1511a7b6a56299bd043a9c167a6d2bfb37bf84a6dfceaba651168adfb43c87"
+dependencies = [
+ "dtoa",
+]
+
+[[package]]
+name = "ego-tree"
+version = "0.6.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "12a0bb14ac04a9fcf170d0bbbef949b44cc492f4452bd20c095636956f653642"
+
+[[package]]
+name = "encoding_rs"
+version = "0.8.35"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3"
+dependencies = [
+ "cfg-if",
+]
+
+[[package]]
+name = "equivalent"
+version = "1.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5"
+
+[[package]]
+name = "errno"
+version = "0.3.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba"
+dependencies = [
+ "libc",
+ "windows-sys 0.52.0",
+]
+
+[[package]]
+name = "fastrand"
+version = "2.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "486f806e73c5707928240ddc295403b1b93c96a02038563881c4a2fd84b81ac4"
+
+[[package]]
+name = "fnv"
+version = "1.0.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
+
+[[package]]
+name = "foreign-types"
+version = "0.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1"
+dependencies = [
+ "foreign-types-shared",
+]
+
+[[package]]
+name = "foreign-types-shared"
+version = "0.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b"
+
+[[package]]
+name = "form_urlencoded"
+version = "1.2.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456"
+dependencies = [
+ "percent-encoding",
+]
+
+[[package]]
+name = "futf"
+version = "0.1.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "df420e2e84819663797d1ec6544b13c5be84629e7bb00dc960d6917db2987843"
+dependencies = [
+ "mac",
+ "new_debug_unreachable",
+]
+
+[[package]]
+name = "futures-channel"
+version = "0.3.31"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10"
+dependencies = [
+ "futures-core",
+]
+
+[[package]]
+name = "futures-core"
+version = "0.3.31"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e"
+
+[[package]]
+name = "futures-io"
+version = "0.3.31"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6"
+
+[[package]]
+name = "futures-sink"
+version = "0.3.31"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7"
+
+[[package]]
+name = "futures-task"
+version = "0.3.31"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988"
+
+[[package]]
+name = "futures-util"
+version = "0.3.31"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81"
+dependencies = [
+ "futures-core",
+ "futures-io",
+ "futures-task",
+ "memchr",
+ "pin-project-lite",
+ "pin-utils",
+ "slab",
+]
+
+[[package]]
+name = "fxhash"
+version = "0.2.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c"
+dependencies = [
+ "byteorder",
+]
+
+[[package]]
+name = "getopts"
+version = "0.2.21"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "14dbbfd5c71d70241ecf9e6f13737f7b5ce823821063188d7e46c41d371eebd5"
+dependencies = [
+ "unicode-width",
+]
+
+[[package]]
+name = "getrandom"
+version = "0.2.15"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7"
+dependencies = [
+ "cfg-if",
+ "libc",
+ "wasi",
+]
+
+[[package]]
+name = "gimli"
+version = "0.31.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f"
+
+[[package]]
+name = "githubchart"
+version = "5.0.0"
+dependencies = [
+ "regex",
+ "reqwest",
+ "scraper",
+]
+
+[[package]]
+name = "h2"
+version = "0.3.26"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8"
+dependencies = [
+ "bytes",
+ "fnv",
+ "futures-core",
+ "futures-sink",
+ "futures-util",
+ "http",
+ "indexmap",
+ "slab",
+ "tokio",
+ "tokio-util",
+ "tracing",
+]
+
+[[package]]
+name = "hashbrown"
+version = "0.15.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3a9bfc1af68b1726ea47d3d5109de126281def866b33970e10fbab11b5dafab3"
+
+[[package]]
+name = "hermit-abi"
+version = "0.3.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024"
+
+[[package]]
+name = "html5ever"
+version = "0.26.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bea68cab48b8459f17cf1c944c67ddc572d272d9f2b274140f223ecb1da4a3b7"
+dependencies = [
+ "log",
+ "mac",
+ "markup5ever",
+ "proc-macro2",
+ "quote",
+ "syn 1.0.109",
+]
+
+[[package]]
+name = "http"
+version = "0.2.12"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1"
+dependencies = [
+ "bytes",
+ "fnv",
+ "itoa",
+]
+
+[[package]]
+name = "http-body"
+version = "0.4.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2"
+dependencies = [
+ "bytes",
+ "http",
+ "pin-project-lite",
+]
+
+[[package]]
+name = "httparse"
+version = "1.9.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7d71d3574edd2771538b901e6549113b4006ece66150fb69c0fb6d9a2adae946"
+
+[[package]]
+name = "httpdate"
+version = "1.0.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9"
+
+[[package]]
+name = "hyper"
+version = "0.14.31"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8c08302e8fa335b151b788c775ff56e7a03ae64ff85c548ee820fecb70356e85"
+dependencies = [
+ "bytes",
+ "futures-channel",
+ "futures-core",
+ "futures-util",
+ "h2",
+ "http",
+ "http-body",
+ "httparse",
+ "httpdate",
+ "itoa",
+ "pin-project-lite",
+ "socket2",
+ "tokio",
+ "tower-service",
+ "tracing",
+ "want",
+]
+
+[[package]]
+name = "hyper-tls"
+version = "0.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905"
+dependencies = [
+ "bytes",
+ "hyper",
+ "native-tls",
+ "tokio",
+ "tokio-native-tls",
+]
+
+[[package]]
+name = "icu_collections"
+version = "1.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526"
+dependencies = [
+ "displaydoc",
+ "yoke",
+ "zerofrom",
+ "zerovec",
+]
+
+[[package]]
+name = "icu_locid"
+version = "1.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637"
+dependencies = [
+ "displaydoc",
+ "litemap",
+ "tinystr",
+ "writeable",
+ "zerovec",
+]
+
+[[package]]
+name = "icu_locid_transform"
+version = "1.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e"
+dependencies = [
+ "displaydoc",
+ "icu_locid",
+ "icu_locid_transform_data",
+ "icu_provider",
+ "tinystr",
+ "zerovec",
+]
+
+[[package]]
+name = "icu_locid_transform_data"
+version = "1.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e"
+
+[[package]]
+name = "icu_normalizer"
+version = "1.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f"
+dependencies = [
+ "displaydoc",
+ "icu_collections",
+ "icu_normalizer_data",
+ "icu_properties",
+ "icu_provider",
+ "smallvec",
+ "utf16_iter",
+ "utf8_iter",
+ "write16",
+ "zerovec",
+]
+
+[[package]]
+name = "icu_normalizer_data"
+version = "1.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516"
+
+[[package]]
+name = "icu_properties"
+version = "1.5.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5"
+dependencies = [
+ "displaydoc",
+ "icu_collections",
+ "icu_locid_transform",
+ "icu_properties_data",
+ "icu_provider",
+ "tinystr",
+ "zerovec",
+]
+
+[[package]]
+name = "icu_properties_data"
+version = "1.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569"
+
+[[package]]
+name = "icu_provider"
+version = "1.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9"
+dependencies = [
+ "displaydoc",
+ "icu_locid",
+ "icu_provider_macros",
+ "stable_deref_trait",
+ "tinystr",
+ "writeable",
+ "yoke",
+ "zerofrom",
+ "zerovec",
+]
+
+[[package]]
+name = "icu_provider_macros"
+version = "1.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.87",
+]
+
+[[package]]
+name = "idna"
+version = "1.0.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e"
+dependencies = [
+ "idna_adapter",
+ "smallvec",
+ "utf8_iter",
+]
+
+[[package]]
+name = "idna_adapter"
+version = "1.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71"
+dependencies = [
+ "icu_normalizer",
+ "icu_properties",
+]
+
+[[package]]
+name = "indexmap"
+version = "2.6.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da"
+dependencies = [
+ "equivalent",
+ "hashbrown",
+]
+
+[[package]]
+name = "ipnet"
+version = "2.10.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708"
+
+[[package]]
+name = "itoa"
+version = "1.0.11"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b"
+
+[[package]]
+name = "js-sys"
+version = "0.3.72"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6a88f1bda2bd75b0452a14784937d796722fdebfe50df998aeb3f0b7603019a9"
+dependencies = [
+ "wasm-bindgen",
+]
+
+[[package]]
+name = "libc"
+version = "0.2.162"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "18d287de67fe55fd7e1581fe933d965a5a9477b38e949cfa9f8574ef01506398"
+
+[[package]]
+name = "linux-raw-sys"
+version = "0.4.14"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89"
+
+[[package]]
+name = "litemap"
+version = "0.7.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "643cb0b8d4fcc284004d5fd0d67ccf61dfffadb7f75e1e71bc420f4688a3a704"
+
+[[package]]
+name = "lock_api"
+version = "0.4.12"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17"
+dependencies = [
+ "autocfg",
+ "scopeguard",
+]
+
+[[package]]
+name = "log"
+version = "0.4.22"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24"
+
+[[package]]
+name = "mac"
+version = "0.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c41e0c4fef86961ac6d6f8a82609f55f31b05e4fce149ac5710e439df7619ba4"
+
+[[package]]
+name = "markup5ever"
+version = "0.11.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7a2629bb1404f3d34c2e921f21fd34ba00b206124c81f65c50b43b6aaefeb016"
+dependencies = [
+ "log",
+ "phf 0.10.1",
+ "phf_codegen",
+ "string_cache",
+ "string_cache_codegen",
+ "tendril",
+]
+
+[[package]]
+name = "memchr"
+version = "2.7.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3"
+
+[[package]]
+name = "mime"
+version = "0.3.17"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a"
+
+[[package]]
+name = "miniz_oxide"
+version = "0.8.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1"
+dependencies = [
+ "adler2",
+]
+
+[[package]]
+name = "mio"
+version = "1.0.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec"
+dependencies = [
+ "hermit-abi",
+ "libc",
+ "wasi",
+ "windows-sys 0.52.0",
+]
+
+[[package]]
+name = "native-tls"
+version = "0.2.12"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466"
+dependencies = [
+ "libc",
+ "log",
+ "openssl",
+ "openssl-probe",
+ "openssl-sys",
+ "schannel",
+ "security-framework",
+ "security-framework-sys",
+ "tempfile",
+]
+
+[[package]]
+name = "new_debug_unreachable"
+version = "1.0.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086"
+
+[[package]]
+name = "object"
+version = "0.36.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e"
+dependencies = [
+ "memchr",
+]
+
+[[package]]
+name = "once_cell"
+version = "1.20.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775"
+
+[[package]]
+name = "openssl"
+version = "0.10.68"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6174bc48f102d208783c2c84bf931bb75927a617866870de8a4ea85597f871f5"
+dependencies = [
+ "bitflags 2.6.0",
+ "cfg-if",
+ "foreign-types",
+ "libc",
+ "once_cell",
+ "openssl-macros",
+ "openssl-sys",
+]
+
+[[package]]
+name = "openssl-macros"
+version = "0.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.87",
+]
+
+[[package]]
+name = "openssl-probe"
+version = "0.1.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf"
+
+[[package]]
+name = "openssl-sys"
+version = "0.9.104"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "45abf306cbf99debc8195b66b7346498d7b10c210de50418b5ccd7ceba08c741"
+dependencies = [
+ "cc",
+ "libc",
+ "pkg-config",
+ "vcpkg",
+]
+
+[[package]]
+name = "parking_lot"
+version = "0.12.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27"
+dependencies = [
+ "lock_api",
+ "parking_lot_core",
+]
+
+[[package]]
+name = "parking_lot_core"
+version = "0.9.10"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8"
+dependencies = [
+ "cfg-if",
+ "libc",
+ "redox_syscall",
+ "smallvec",
+ "windows-targets 0.52.6",
+]
+
+[[package]]
+name = "percent-encoding"
+version = "2.3.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e"
+
+[[package]]
+name = "phf"
+version = "0.10.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fabbf1ead8a5bcbc20f5f8b939ee3f5b0f6f281b6ad3468b84656b658b455259"
+dependencies = [
+ "phf_shared 0.10.0",
+]
+
+[[package]]
+name = "phf"
+version = "0.11.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc"
+dependencies = [
+ "phf_macros",
+ "phf_shared 0.11.2",
+]
+
+[[package]]
+name = "phf_codegen"
+version = "0.10.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4fb1c3a8bc4dd4e5cfce29b44ffc14bedd2ee294559a294e2a4d4c9e9a6a13cd"
+dependencies = [
+ "phf_generator 0.10.0",
+ "phf_shared 0.10.0",
+]
+
+[[package]]
+name = "phf_generator"
+version = "0.10.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5d5285893bb5eb82e6aaf5d59ee909a06a16737a8970984dd7746ba9283498d6"
+dependencies = [
+ "phf_shared 0.10.0",
+ "rand",
+]
+
+[[package]]
+name = "phf_generator"
+version = "0.11.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0"
+dependencies = [
+ "phf_shared 0.11.2",
+ "rand",
+]
+
+[[package]]
+name = "phf_macros"
+version = "0.11.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3444646e286606587e49f3bcf1679b8cef1dc2c5ecc29ddacaffc305180d464b"
+dependencies = [
+ "phf_generator 0.11.2",
+ "phf_shared 0.11.2",
+ "proc-macro2",
+ "quote",
+ "syn 2.0.87",
+]
+
+[[package]]
+name = "phf_shared"
+version = "0.10.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b6796ad771acdc0123d2a88dc428b5e38ef24456743ddb1744ed628f9815c096"
+dependencies = [
+ "siphasher",
+]
+
+[[package]]
+name = "phf_shared"
+version = "0.11.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b"
+dependencies = [
+ "siphasher",
+]
+
+[[package]]
+name = "pin-project-lite"
+version = "0.2.15"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff"
+
+[[package]]
+name = "pin-utils"
+version = "0.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
+
+[[package]]
+name = "pkg-config"
+version = "0.3.31"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2"
+
+[[package]]
+name = "ppv-lite86"
+version = "0.2.20"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04"
+dependencies = [
+ "zerocopy",
+]
+
+[[package]]
+name = "precomputed-hash"
+version = "0.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c"
+
+[[package]]
+name = "proc-macro2"
+version = "1.0.89"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e"
+dependencies = [
+ "unicode-ident",
+]
+
+[[package]]
+name = "quote"
+version = "1.0.37"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af"
+dependencies = [
+ "proc-macro2",
+]
+
+[[package]]
+name = "rand"
+version = "0.8.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404"
+dependencies = [
+ "libc",
+ "rand_chacha",
+ "rand_core",
+]
+
+[[package]]
+name = "rand_chacha"
+version = "0.3.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88"
+dependencies = [
+ "ppv-lite86",
+ "rand_core",
+]
+
+[[package]]
+name = "rand_core"
+version = "0.6.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
+dependencies = [
+ "getrandom",
+]
+
+[[package]]
+name = "redox_syscall"
+version = "0.5.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f"
+dependencies = [
+ "bitflags 2.6.0",
+]
+
+[[package]]
+name = "regex"
+version = "1.11.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191"
+dependencies = [
+ "aho-corasick",
+ "memchr",
+ "regex-automata",
+ "regex-syntax",
+]
+
+[[package]]
+name = "regex-automata"
+version = "0.4.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908"
+dependencies = [
+ "aho-corasick",
+ "memchr",
+ "regex-syntax",
+]
+
+[[package]]
+name = "regex-syntax"
+version = "0.8.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c"
+
+[[package]]
+name = "reqwest"
+version = "0.11.27"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62"
+dependencies = [
+ "base64",
+ "bytes",
+ "encoding_rs",
+ "futures-core",
+ "futures-util",
+ "h2",
+ "http",
+ "http-body",
+ "hyper",
+ "hyper-tls",
+ "ipnet",
+ "js-sys",
+ "log",
+ "mime",
+ "native-tls",
+ "once_cell",
+ "percent-encoding",
+ "pin-project-lite",
+ "rustls-pemfile",
+ "serde",
+ "serde_json",
+ "serde_urlencoded",
+ "sync_wrapper",
+ "system-configuration",
+ "tokio",
+ "tokio-native-tls",
+ "tower-service",
+ "url",
+ "wasm-bindgen",
+ "wasm-bindgen-futures",
+ "web-sys",
+ "winreg",
+]
+
+[[package]]
+name = "rustc-demangle"
+version = "0.1.24"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f"
+
+[[package]]
+name = "rustix"
+version = "0.38.40"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "99e4ea3e1cdc4b559b8e5650f9c8e5998e3e5c1343b4eaf034565f32318d63c0"
+dependencies = [
+ "bitflags 2.6.0",
+ "errno",
+ "libc",
+ "linux-raw-sys",
+ "windows-sys 0.52.0",
+]
+
+[[package]]
+name = "rustls-pemfile"
+version = "1.0.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c"
+dependencies = [
+ "base64",
+]
+
+[[package]]
+name = "ryu"
+version = "1.0.18"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f"
+
+[[package]]
+name = "schannel"
+version = "0.1.26"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1"
+dependencies = [
+ "windows-sys 0.59.0",
+]
+
+[[package]]
+name = "scopeguard"
+version = "1.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
+
+[[package]]
+name = "scraper"
+version = "0.17.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c95a930e03325234c18c7071fd2b60118307e025d6fff3e12745ffbf63a3d29c"
+dependencies = [
+ "ahash",
+ "cssparser",
+ "ego-tree",
+ "getopts",
+ "html5ever",
+ "once_cell",
+ "selectors",
+ "smallvec",
+ "tendril",
+]
+
+[[package]]
+name = "security-framework"
+version = "2.11.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02"
+dependencies = [
+ "bitflags 2.6.0",
+ "core-foundation",
+ "core-foundation-sys",
+ "libc",
+ "security-framework-sys",
+]
+
+[[package]]
+name = "security-framework-sys"
+version = "2.12.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fa39c7303dc58b5543c94d22c1766b0d31f2ee58306363ea622b10bbc075eaa2"
+dependencies = [
+ "core-foundation-sys",
+ "libc",
+]
+
+[[package]]
+name = "selectors"
+version = "0.25.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4eb30575f3638fc8f6815f448d50cb1a2e255b0897985c8c59f4d37b72a07b06"
+dependencies = [
+ "bitflags 2.6.0",
+ "cssparser",
+ "derive_more",
+ "fxhash",
+ "log",
+ "new_debug_unreachable",
+ "phf 0.10.1",
+ "phf_codegen",
+ "precomputed-hash",
+ "servo_arc",
+ "smallvec",
+]
+
+[[package]]
+name = "serde"
+version = "1.0.215"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6513c1ad0b11a9376da888e3e0baa0077f1aed55c17f50e7b2397136129fb88f"
+dependencies = [
+ "serde_derive",
+]
+
+[[package]]
+name = "serde_derive"
+version = "1.0.215"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.87",
+]
+
+[[package]]
+name = "serde_json"
+version = "1.0.132"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d726bfaff4b320266d395898905d0eba0345aae23b54aee3a737e260fd46db03"
+dependencies = [
+ "itoa",
+ "memchr",
+ "ryu",
+ "serde",
+]
+
+[[package]]
+name = "serde_urlencoded"
+version = "0.7.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd"
+dependencies = [
+ "form_urlencoded",
+ "itoa",
+ "ryu",
+ "serde",
+]
+
+[[package]]
+name = "servo_arc"
+version = "0.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d036d71a959e00c77a63538b90a6c2390969f9772b096ea837205c6bd0491a44"
+dependencies = [
+ "stable_deref_trait",
+]
+
+[[package]]
+name = "shlex"
+version = "1.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
+
+[[package]]
+name = "siphasher"
+version = "0.3.11"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d"
+
+[[package]]
+name = "slab"
+version = "0.4.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67"
+dependencies = [
+ "autocfg",
+]
+
+[[package]]
+name = "smallvec"
+version = "1.13.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67"
+
+[[package]]
+name = "socket2"
+version = "0.5.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c"
+dependencies = [
+ "libc",
+ "windows-sys 0.52.0",
+]
+
+[[package]]
+name = "stable_deref_trait"
+version = "1.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3"
+
+[[package]]
+name = "string_cache"
+version = "0.8.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f91138e76242f575eb1d3b38b4f1362f10d3a43f47d182a5b359af488a02293b"
+dependencies = [
+ "new_debug_unreachable",
+ "once_cell",
+ "parking_lot",
+ "phf_shared 0.10.0",
+ "precomputed-hash",
+ "serde",
+]
+
+[[package]]
+name = "string_cache_codegen"
+version = "0.5.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6bb30289b722be4ff74a408c3cc27edeaad656e06cb1fe8fa9231fa59c728988"
+dependencies = [
+ "phf_generator 0.10.0",
+ "phf_shared 0.10.0",
+ "proc-macro2",
+ "quote",
+]
+
+[[package]]
+name = "syn"
+version = "1.0.109"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "unicode-ident",
+]
+
+[[package]]
+name = "syn"
+version = "2.0.87"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "unicode-ident",
+]
+
+[[package]]
+name = "sync_wrapper"
+version = "0.1.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160"
+
+[[package]]
+name = "synstructure"
+version = "0.13.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.87",
+]
+
+[[package]]
+name = "system-configuration"
+version = "0.5.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7"
+dependencies = [
+ "bitflags 1.3.2",
+ "core-foundation",
+ "system-configuration-sys",
+]
+
+[[package]]
+name = "system-configuration-sys"
+version = "0.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9"
+dependencies = [
+ "core-foundation-sys",
+ "libc",
+]
+
+[[package]]
+name = "tempfile"
+version = "3.14.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "28cce251fcbc87fac86a866eeb0d6c2d536fc16d06f184bb61aeae11aa4cee0c"
+dependencies = [
+ "cfg-if",
+ "fastrand",
+ "once_cell",
+ "rustix",
+ "windows-sys 0.59.0",
+]
+
+[[package]]
+name = "tendril"
+version = "0.4.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d24a120c5fc464a3458240ee02c299ebcb9d67b5249c8848b09d639dca8d7bb0"
+dependencies = [
+ "futf",
+ "mac",
+ "utf-8",
+]
+
+[[package]]
+name = "tinystr"
+version = "0.7.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f"
+dependencies = [
+ "displaydoc",
+ "zerovec",
+]
+
+[[package]]
+name = "tokio"
+version = "1.41.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "22cfb5bee7a6a52939ca9224d6ac897bb669134078daa8735560897f69de4d33"
+dependencies = [
+ "backtrace",
+ "bytes",
+ "libc",
+ "mio",
+ "pin-project-lite",
+ "socket2",
+ "windows-sys 0.52.0",
+]
+
+[[package]]
+name = "tokio-native-tls"
+version = "0.3.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2"
+dependencies = [
+ "native-tls",
+ "tokio",
+]
+
+[[package]]
+name = "tokio-util"
+version = "0.7.12"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a"
+dependencies = [
+ "bytes",
+ "futures-core",
+ "futures-sink",
+ "pin-project-lite",
+ "tokio",
+]
+
+[[package]]
+name = "tower-service"
+version = "0.3.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3"
+
+[[package]]
+name = "tracing"
+version = "0.1.40"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef"
+dependencies = [
+ "pin-project-lite",
+ "tracing-core",
+]
+
+[[package]]
+name = "tracing-core"
+version = "0.1.32"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54"
+dependencies = [
+ "once_cell",
+]
+
+[[package]]
+name = "try-lock"
+version = "0.2.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b"
+
+[[package]]
+name = "unicode-ident"
+version = "1.0.13"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe"
+
+[[package]]
+name = "unicode-width"
+version = "0.1.14"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af"
+
+[[package]]
+name = "url"
+version = "2.5.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8d157f1b96d14500ffdc1f10ba712e780825526c03d9a49b4d0324b0d9113ada"
+dependencies = [
+ "form_urlencoded",
+ "idna",
+ "percent-encoding",
+]
+
+[[package]]
+name = "utf-8"
+version = "0.7.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9"
+
+[[package]]
+name = "utf16_iter"
+version = "1.0.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246"
+
+[[package]]
+name = "utf8_iter"
+version = "1.0.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be"
+
+[[package]]
+name = "vcpkg"
+version = "0.2.15"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426"
+
+[[package]]
+name = "version_check"
+version = "0.9.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a"
+
+[[package]]
+name = "want"
+version = "0.3.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e"
+dependencies = [
+ "try-lock",
+]
+
+[[package]]
+name = "wasi"
+version = "0.11.0+wasi-snapshot-preview1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
+
+[[package]]
+name = "wasm-bindgen"
+version = "0.2.95"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "128d1e363af62632b8eb57219c8fd7877144af57558fb2ef0368d0087bddeb2e"
+dependencies = [
+ "cfg-if",
+ "once_cell",
+ "wasm-bindgen-macro",
+]
+
+[[package]]
+name = "wasm-bindgen-backend"
+version = "0.2.95"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cb6dd4d3ca0ddffd1dd1c9c04f94b868c37ff5fac97c30b97cff2d74fce3a358"
+dependencies = [
+ "bumpalo",
+ "log",
+ "once_cell",
+ "proc-macro2",
+ "quote",
+ "syn 2.0.87",
+ "wasm-bindgen-shared",
+]
+
+[[package]]
+name = "wasm-bindgen-futures"
+version = "0.4.45"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cc7ec4f8827a71586374db3e87abdb5a2bb3a15afed140221307c3ec06b1f63b"
+dependencies = [
+ "cfg-if",
+ "js-sys",
+ "wasm-bindgen",
+ "web-sys",
+]
+
+[[package]]
+name = "wasm-bindgen-macro"
+version = "0.2.95"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e79384be7f8f5a9dd5d7167216f022090cf1f9ec128e6e6a482a2cb5c5422c56"
+dependencies = [
+ "quote",
+ "wasm-bindgen-macro-support",
+]
+
+[[package]]
+name = "wasm-bindgen-macro-support"
+version = "0.2.95"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.87",
+ "wasm-bindgen-backend",
+ "wasm-bindgen-shared",
+]
+
+[[package]]
+name = "wasm-bindgen-shared"
+version = "0.2.95"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d"
+
+[[package]]
+name = "web-sys"
+version = "0.3.72"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f6488b90108c040df0fe62fa815cbdee25124641df01814dd7282749234c6112"
+dependencies = [
+ "js-sys",
+ "wasm-bindgen",
+]
+
+[[package]]
+name = "windows-sys"
+version = "0.48.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9"
+dependencies = [
+ "windows-targets 0.48.5",
+]
+
+[[package]]
+name = "windows-sys"
+version = "0.52.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d"
+dependencies = [
+ "windows-targets 0.52.6",
+]
+
+[[package]]
+name = "windows-sys"
+version = "0.59.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b"
+dependencies = [
+ "windows-targets 0.52.6",
+]
+
+[[package]]
+name = "windows-targets"
+version = "0.48.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c"
+dependencies = [
+ "windows_aarch64_gnullvm 0.48.5",
+ "windows_aarch64_msvc 0.48.5",
+ "windows_i686_gnu 0.48.5",
+ "windows_i686_msvc 0.48.5",
+ "windows_x86_64_gnu 0.48.5",
+ "windows_x86_64_gnullvm 0.48.5",
+ "windows_x86_64_msvc 0.48.5",
+]
+
+[[package]]
+name = "windows-targets"
+version = "0.52.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973"
+dependencies = [
+ "windows_aarch64_gnullvm 0.52.6",
+ "windows_aarch64_msvc 0.52.6",
+ "windows_i686_gnu 0.52.6",
+ "windows_i686_gnullvm",
+ "windows_i686_msvc 0.52.6",
+ "windows_x86_64_gnu 0.52.6",
+ "windows_x86_64_gnullvm 0.52.6",
+ "windows_x86_64_msvc 0.52.6",
+]
+
+[[package]]
+name = "windows_aarch64_gnullvm"
+version = "0.48.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8"
+
+[[package]]
+name = "windows_aarch64_gnullvm"
+version = "0.52.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"
+
+[[package]]
+name = "windows_aarch64_msvc"
+version = "0.48.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc"
+
+[[package]]
+name = "windows_aarch64_msvc"
+version = "0.52.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"
+
+[[package]]
+name = "windows_i686_gnu"
+version = "0.48.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e"
+
+[[package]]
+name = "windows_i686_gnu"
+version = "0.52.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b"
+
+[[package]]
+name = "windows_i686_gnullvm"
+version = "0.52.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"
+
+[[package]]
+name = "windows_i686_msvc"
+version = "0.48.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406"
+
+[[package]]
+name = "windows_i686_msvc"
+version = "0.52.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"
+
+[[package]]
+name = "windows_x86_64_gnu"
+version = "0.48.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e"
+
+[[package]]
+name = "windows_x86_64_gnu"
+version = "0.52.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"
+
+[[package]]
+name = "windows_x86_64_gnullvm"
+version = "0.48.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc"
+
+[[package]]
+name = "windows_x86_64_gnullvm"
+version = "0.52.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"
+
+[[package]]
+name = "windows_x86_64_msvc"
+version = "0.48.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538"
+
+[[package]]
+name = "windows_x86_64_msvc"
+version = "0.52.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
+
+[[package]]
+name = "winreg"
+version = "0.50.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1"
+dependencies = [
+ "cfg-if",
+ "windows-sys 0.48.0",
+]
+
+[[package]]
+name = "write16"
+version = "1.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936"
+
+[[package]]
+name = "writeable"
+version = "0.5.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51"
+
+[[package]]
+name = "yoke"
+version = "0.7.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6c5b1314b079b0930c31e3af543d8ee1757b1951ae1e1565ec704403a7240ca5"
+dependencies = [
+ "serde",
+ "stable_deref_trait",
+ "yoke-derive",
+ "zerofrom",
+]
+
+[[package]]
+name = "yoke-derive"
+version = "0.7.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "28cc31741b18cb6f1d5ff12f5b7523e3d6eb0852bbbad19d73905511d9849b95"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.87",
+ "synstructure",
+]
+
+[[package]]
+name = "zerocopy"
+version = "0.7.35"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0"
+dependencies = [
+ "byteorder",
+ "zerocopy-derive",
+]
+
+[[package]]
+name = "zerocopy-derive"
+version = "0.7.35"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.87",
+]
+
+[[package]]
+name = "zerofrom"
+version = "0.1.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "91ec111ce797d0e0784a1116d0ddcdbea84322cd79e5d5ad173daeba4f93ab55"
+dependencies = [
+ "zerofrom-derive",
+]
+
+[[package]]
+name = "zerofrom-derive"
+version = "0.1.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0ea7b4a3637ea8669cedf0f1fd5c286a17f3de97b8dd5a70a6c167a1730e63a5"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.87",
+ "synstructure",
+]
+
+[[package]]
+name = "zerovec"
+version = "0.10.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079"
+dependencies = [
+ "yoke",
+ "zerofrom",
+ "zerovec-derive",
+]
+
+[[package]]
+name = "zerovec-derive"
+version = "0.10.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.87",
+]
diff --git a/Cargo.toml b/Cargo.toml
new file mode 100644
index 0000000..ac7bfd4
--- /dev/null
+++ b/Cargo.toml
@@ -0,0 +1,18 @@
+[package]
+name = "githubchart"
+version = "5.0.0"
+authors = ["frytg"]
+edition = "2021"
+
+[dependencies]
+regex = "1.11.1"
+reqwest = { version = "0.11", features = ["blocking", "json"] }
+scraper = "0.17"
+
+[profile.release]
+# optimizations from https://github.com/johnthagen/min-sized-rust
+opt-level = 'z' # optimize for size
+lto = true # enable link time optimization
+codegen-units = 1 # reduce parallel codegen units to increase optimizations
+panic = 'abort' # abort on panic
+strip = true # strip symbols from binary
diff --git a/Gemfile b/Gemfile
deleted file mode 100644
index fa75df1..0000000
--- a/Gemfile
+++ /dev/null
@@ -1,3 +0,0 @@
-source 'https://rubygems.org'
-
-gemspec
diff --git a/README.md b/README.md
index 414b5d4..0bcf9aa 100644
--- a/README.md
+++ b/README.md
@@ -1,35 +1,51 @@
-GithubChart
-============
+# GitHubChart (The Rusty Version)
-[![Gem Version](https://img.shields.io/gem/v/githubchart.svg)](https://rubygems.org/gems/githubchart)
-[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/akerl/githubchart/build.yml?branch=main)](https://github.com/akerl/githubchart/actions)
-[![MIT Licensed](https://img.shields.io/badge/license-MIT-green.svg)](https://tldrlegal.com/license/mit-license)
+Generates an SVG of your GitHub contributions:
-Generates an SVG of your Github contributions:
+![Example image](./assets/frytg.svg)
-![Example image](http://akerl.github.io/githubchart/chart.svg)
+## Fork
-![Other user example](http://akerl.github.io/githubchart/other_user.svg)
+This is forked from [githubchart](https://github.com/akerl/githubchart) and ported from Ruby to Rust. It does not provide 100% of the same functionality, but it does generate a similar SVG.
-## Usage
+## Usage with `cargo`
-Run `githubchart path/to/svg` to generate an SVG. To override the default username (pulled from your local shell or .gitconfig), use `githubchart -u username path/to/svg`
+If you have Rust installed and are familiar with cargo, you can install and run this directly:
-GithubChart also allows you to provide input from a file instead of pulling data from Github. You can pass JSON to GithubChart by using `githubchart -i /path/to/file /path/to/svg`, or use '-' to use STDIN. See spec/examples/input.json for example data.
+```sh
+cargo run -- output.svg -u frytg
+```
-If you don't provide a file path, the resulting SVG will be printed to stdout.
+This compiles and runs the program directly (using dev profile and debug symbols). This would also be the command when developing locally.
-To modify the color scheme used, you can provide `-c SCHEME`. For example, `githubchart -c halloween` uses GitHub's halloween colors. Use `-s` to list the available schemes.
+To modify the color scheme used, you can provide `-c SCHEME`. For example, `cargo run -- output.svg -u frytg -c halloween` uses GitHub's halloween colors.
-### Hosted SVG
+Use `cargo fmt` to format the code and `cargo test` to run the tests.
-A hosted service for loading these SVGs was made by [2016rshah](https://github.com/2016rshah): http://ghchart.rshah.org/ ([source code](https://github.com/2016rshah/githubchart-api))
+## Usage with binary
-## Installation
+Alternatively, you can download a release binary from the [releases page](https://github.com/frytg/githubchart-rust/releases) and run it directly:
- gem install githubchart
+```sh
+./githubchart output.svg -u frytg
+```
-## License
+## Build
+
+You can build a release binary with:
+
+```sh
+cargo build --release
+```
+
+[`Cargo.toml`](./Cargo.toml) is configured to optimize for size.
-githubchart is released under the MIT License. See the bundled LICENSE file for details.
+Test the binary with:
+
+```sh
+./target/release/githubchart release.svg -u frytg
+```
+
+## License
+This `githubchart-rust` fork (like the upstream repo) is released under the MIT License. See the bundled [LICENSE](./LICENSE) file for details.
diff --git a/Rakefile b/Rakefile
deleted file mode 100644
index 70f40c0..0000000
--- a/Rakefile
+++ /dev/null
@@ -1,14 +0,0 @@
-require 'bundler/gem_tasks'
-require 'rspec/core/rake_task'
-require 'rubocop/rake_task'
-
-desc 'Run tests'
-RSpec::Core::RakeTask.new(:spec)
-
-desc 'Run Rubocop on the gem'
-RuboCop::RakeTask.new(:rubocop) do |task|
- task.patterns = ['lib/**/*.rb', 'spec/**/*.rb', 'bin/**/*']
- task.fail_on_error = true
-end
-
-task default: %i[spec rubocop build install]
diff --git a/bin/githubchart b/bin/githubchart
deleted file mode 100755
index def9582..0000000
--- a/bin/githubchart
+++ /dev/null
@@ -1,67 +0,0 @@
-#!/usr/bin/env ruby
-
-require 'githubchart'
-require 'optparse'
-
-# rubocop:disable Metrics/BlockLength
-options = {}
-render_type = 'svg'.freeze
-
-OptionParser.new do |opts|
- opts.banner =
- "Usage: githubchart (-u username) (-t type) path/for/new/image\n"
- opts.banner << "Supported types: #{GithubChart.supported.join(' ')}"
- opts.on('-uUSER', '--user=USER', 'Specify GitHub user to graph') do |user|
- raise('The --user and --input flags are incompatible with each other.') if options.include? :input
- options[:user] = user
- end
- opts.on('-iFILE', '--input=FILE', 'Specify JSON file, - for stdin') do |input|
- raise('The --user and --input flags are incompatible with each other.') if options.include? :user
- if input.eql? '-'
- raise 'No data provided on stdin' if $stdin.tty?
- contents = $stdin.read
- else
- raise 'File does not exist' unless File.exist? input
- contents = File.read input
- end
- begin
- parsed = JSON.parse(contents)
- rescue StandardError => e
- raise "Unable to parse JSON data provided: #{e}"
- end
- options[:data] = GithubStats::Data.new(parsed)
- end
- opts.on('-cSCHEME', '--colors SCHEME', 'Pick a color scheme') do |scheme|
- is_good_scheme = GithubChart::COLOR_SCHEMES.include? scheme.to_sym
- raise('Unknown color scheme provided') unless is_good_scheme
- options[:colors] = scheme.to_sym
- end
- opts.on('-s', '--schemes', 'List known color schemes') do
- puts 'Color schemes:'
- GithubChart::COLOR_SCHEMES.each do |scheme, colors|
- puts " #{scheme}: #{colors}"
- end
- exit
- end
- opts.on('-t TYPE', '--type TYPE', 'What type to render') do |type|
- raise('Unsupported render type') unless GithubChart.supported.include?(
- type.to_sym
- )
- render_type = type
- end
- opts.on_tail('-v', '--version', 'Show version') do
- puts GithubChart::VERSION
- exit
- end
-end.parse!
-# rubocop:enable Metrics/BlockLength
-
-SVG_Path = ARGV.shift
-
-Chart = GithubChart.new(options).render(render_type)
-
-if SVG_Path.nil?
- puts Chart
-else
- File.open(SVG_Path, 'w') { |file| file << Chart }
-end
diff --git a/examples/chart.svg b/examples/chart.svg
deleted file mode 100644
index 55d5995..0000000
--- a/examples/chart.svg
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
\ No newline at end of file
diff --git a/examples/other_user.svg b/examples/other_user.svg
deleted file mode 100644
index 41da69c..0000000
--- a/examples/other_user.svg
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
\ No newline at end of file
diff --git a/githubchart.gemspec b/githubchart.gemspec
deleted file mode 100644
index 92d39fe..0000000
--- a/githubchart.gemspec
+++ /dev/null
@@ -1,24 +0,0 @@
-require 'English'
-$LOAD_PATH.unshift File.expand_path('lib', __dir__)
-require 'githubchart/version'
-
-Gem::Specification.new do |s|
- s.name = 'githubchart'
- s.version = GithubChart::VERSION
- s.summary = 'Generate an SVG of Github contributions data'
- s.description = 'Uses GithubStats to grab Github contributions scores and converts that into an SVG'
- s.authors = ['Les Aker']
- s.email = 'me@lesaker.org'
- s.homepage = 'https://github.com/akerl/githubchart'
- s.license = 'MIT'
-
- s.files = `git ls-files`.split
- s.executables = ['githubchart']
-
- s.add_runtime_dependency 'githubstats', '~> 4.0.1'
- s.add_runtime_dependency 'matrix', '~> 0.4.2'
- s.add_runtime_dependency 'svgplot', '~> 1.0.0'
-
- s.add_development_dependency 'goodcop', '~> 0.9.7'
- s.metadata['rubygems_mfa_required'] = 'true'
-end
diff --git a/lib/githubchart.rb b/lib/githubchart.rb
deleted file mode 100644
index 493cdc1..0000000
--- a/lib/githubchart.rb
+++ /dev/null
@@ -1,113 +0,0 @@
-require 'githubstats'
-require 'matrix'
-
-##
-# Graphing tool for creating Github-style contribution charts
-module GithubChart
- class << self
- ##
- # Helper to create new charts
-
- def new(*args)
- self::Chart.new(*args)
- end
-
- ##
- # Helper to list supported types
-
- def supported
- @supported ||= []
- end
-
- ##
- # Helper to check for type support
-
- def supports?(type)
- supported.include? type.to_sym
- end
-
- protected
-
- ##
- # Add support for a type
-
- def add_support(type)
- @supported ||= []
- @supported << type.to_sym
- end
- end
-
- ##
- # Color schemes for gradient
- COLOR_SCHEMES = {
- default: ['#eeeeee', '#c6e48b', '#7bc96f', '#239a3b', '#196127'],
- old: ['#eeeeee', '#d6e685', '#8cc665', '#44a340', '#1e6823'],
- halloween: ['#EEEEEE', '#FFEE4A', '#FFC501', '#FE9600', '#03001C']
- }.freeze
-
- ##
- # Object for parsing and outputing Github stats data
- class Chart
- attr_reader :stats
- attr_accessor :colors
-
- ##
- # Create a new chart object
- # Passes the username through to GithubStats
- # Uses colors rather than default, if provided
-
- def initialize(params = {})
- params = { user: params } unless params.is_a? Hash
- @stats = load_stats(params[:data], params[:user])
- @colors = params[:colors] || :default
- @colors = COLOR_SCHEMES[@colors] unless @colors.is_a? Array
- end
-
- def render(type)
- raise(NameError, "Format #{type} is unsupported.") unless GithubChart.supports? type
- send("render_#{type}".to_sym)
- end
-
- private
-
- ##
- # Load stats from provided arg or github
-
- def load_stats(data, user)
- return data if data
- raise('No data or user provided') unless user
- stats = GithubStats.new(user).data
- raise("Failed to find data for #{user} on GitHub") unless stats
- stats
- end
-
- ##
- # Convert the data into a matrix of weeks
- # The fill value is used to pad the front and back
-
- def matrix(fill_value = -1)
- Matrix[*@stats.pad(fill_value).each_slice(7).to_a.transpose]
- end
- end
-end
-
-##
-# Add helper methods to Integer
-class Integer
- ##
- # Add ordinalize to simplify converting to spoken string
-
- def ordinalize
- return to_s if zero?
- return "#{self}th" if (11..13).cover?(abs % 100)
- case abs % 10
- when 1 then "#{self}st"
- when 2 then "#{self}nd"
- when 3 then "#{self}rd"
- else "#{self}th"
- end
- end
-end
-
-require 'githubchart/version'
-require 'githubchart/svg'
diff --git a/lib/githubchart/svg.rb b/lib/githubchart/svg.rb
deleted file mode 100644
index 873cd40..0000000
--- a/lib/githubchart/svg.rb
+++ /dev/null
@@ -1,112 +0,0 @@
-require 'svgplot'
-
-##
-# Add SVG support to GithubChart
-module GithubChart
- ##
- # Declare SVG support
-
- add_support(:svg)
- add_support(:svg_square)
-
- ##
- # Convert stats into SVG
- class Chart
- private
-
- CUBE_SIZE = 12
- X_PAD = 27
- Y_PAD = 20
-
- def render_svg
- grid = matrix
- chart = SVGPlot.new(width: (CUBE_SIZE * grid.column_size) + X_PAD,
- height: (CUBE_SIZE * grid.row_size) + Y_PAD)
- svg_add_points grid, chart
- svg_add_weekdays chart
- svg_add_months chart
- chart.to_s
- end
-
- def render_svg_square
- grid = matrix.minor(0, 7, -7, 7)
- chart = SVGPlot.new(width: (CUBE_SIZE * grid.column_size) - 2,
- height: (CUBE_SIZE * grid.row_size) - 2)
- svg_add_points grid, chart, 0, 0
- chart.to_s
- end
-
- ##
- # Define shared label style
-
- SVG_SHARED_STYLE = {
- fill: '#767676',
- 'text-anchor': 'start',
- 'text-align': 'center',
- 'font-family': '-apple-system, BlinkMacSystemFont, \'Segoe UI\', Helvetica, Arial, sans-serif, \'Apple Color Emoji\', \'Segoe UI Emoji\', \'Segoe UI Symbol\'', # rubocop:disable Layout/LineLength
- 'white-space': 'nowrap'
- }.freeze
-
- ##
- # Define style for weekday labels
-
- SVG_WEEKDAY_STYLE = SVG_SHARED_STYLE.dup.merge('font-size': '9px').freeze
-
- ##
- # Define Style for month labels
-
- SVG_MONTH_STYLE = SVG_SHARED_STYLE.dup.merge('font-size': '10px').freeze
-
- def svg_point_style(point)
- {
- fill: @colors[@stats.quartile(point.score)],
- 'shape-rendering': 'crispedges'
- }
- end
-
- def svg_add_points(grid, chart, xpadding = X_PAD, ypadding = Y_PAD)
- grid.each_with_index do |point, y, x|
- next if point.score == -1
- chart.rectangle(
- (x * CUBE_SIZE) + xpadding, (y * CUBE_SIZE) + ypadding, 10, 10,
- data: { score: point.score, date: point.date },
- style: svg_point_style(point)
- )
- end
- end
-
- def svg_add_weekday(chart, point)
- index = point.date.wday
- letter = point.date.strftime('%a')
- style = SVG_WEEKDAY_STYLE.dup
- style[:display] = 'none' unless [1, 3, 5].include? index
- shift = index > 3 ? 29 : 28
- chart.text(0, (CUBE_SIZE * index) + shift, style: style) { raw letter }
- end
-
- def svg_add_weekdays(chart)
- @stats.raw.first(7).each { |point| svg_add_weekday chart, point }
- end
-
- def svg_get_month_offsets # rubocop:disable Metrics/AbcSize
- list = @stats.raw.select { |x| x.date.sunday? }
- list.unshift(@stats.raw.first) unless @stats.raw.first.date.sunday?
- list.map! { |x| x.date.strftime('%b') }
- acc = 0
- list.chunk { |x| x }.map do |month, offset|
- acc += offset.size
- [month, acc - offset.size]
- end
- end
-
- def svg_add_months(chart)
- offsets = svg_get_month_offsets
- offsets.shift if [1, 2].include? offsets[1].last
- offsets.each do |month, offset|
- next if offset > 50
- x = (CUBE_SIZE * offset) + X_PAD
- chart.text(x, 10, style: SVG_MONTH_STYLE) { raw month }
- end
- end
- end
-end
diff --git a/lib/githubchart/version.rb b/lib/githubchart/version.rb
deleted file mode 100644
index 4578a4d..0000000
--- a/lib/githubchart/version.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-##
-# Define the version
-module GithubChart
- VERSION = '4.0.0'.freeze
-end
diff --git a/spec/examples/input.json b/spec/examples/input.json
deleted file mode 100644
index 946be39..0000000
--- a/spec/examples/input.json
+++ /dev/null
@@ -1 +0,0 @@
-[["2013/08/30",0],["2013/08/31",2],["2013/09/01",0],["2013/09/02",0],["2013/09/03",0],["2013/09/04",0],["2013/09/05",0],["2013/09/06",0],["2013/09/07",0],["2013/09/08",0],["2013/09/09",0],["2013/09/10",0],["2013/09/11",0],["2013/09/12",0],["2013/09/13",0],["2013/09/14",0],["2013/09/15",0],["2013/09/16",0],["2013/09/17",0],["2013/09/18",0],["2013/09/19",0],["2013/09/20",0],["2013/09/21",8],["2013/09/22",0],["2013/09/23",0],["2013/09/24",0],["2013/09/25",0],["2013/09/26",0],["2013/09/27",0],["2013/09/28",0],["2013/09/29",0],["2013/09/30",8],["2013/10/01",0],["2013/10/02",1],["2013/10/03",0],["2013/10/04",0],["2013/10/05",1],["2013/10/06",0],["2013/10/07",7],["2013/10/08",10],["2013/10/09",0],["2013/10/10",2],["2013/10/11",0],["2013/10/12",0],["2013/10/13",0],["2013/10/14",0],["2013/10/15",0],["2013/10/16",0],["2013/10/17",0],["2013/10/18",0],["2013/10/19",0],["2013/10/20",0],["2013/10/21",1],["2013/10/22",0],["2013/10/23",0],["2013/10/24",0],["2013/10/25",0],["2013/10/26",0],["2013/10/27",0],["2013/10/28",0],["2013/10/29",0],["2013/10/30",0],["2013/10/31",0],["2013/11/01",0],["2013/11/02",5],["2013/11/03",0],["2013/11/04",0],["2013/11/05",0],["2013/11/06",0],["2013/11/07",0],["2013/11/08",0],["2013/11/09",0],["2013/11/10",0],["2013/11/11",0],["2013/11/12",0],["2013/11/13",0],["2013/11/14",0],["2013/11/15",0],["2013/11/16",1],["2013/11/17",0],["2013/11/18",0],["2013/11/19",0],["2013/11/20",0],["2013/11/21",0],["2013/11/22",0],["2013/11/23",0],["2013/11/24",1],["2013/11/25",9],["2013/11/26",1],["2013/11/27",0],["2013/11/28",0],["2013/11/29",4],["2013/11/30",0],["2013/12/01",17],["2013/12/02",0],["2013/12/03",1],["2013/12/04",9],["2013/12/05",3],["2013/12/06",7],["2013/12/07",1],["2013/12/08",6],["2013/12/09",6],["2013/12/10",1],["2013/12/11",2],["2013/12/12",2],["2013/12/13",1],["2013/12/14",13],["2013/12/15",1],["2013/12/16",3],["2013/12/17",1],["2013/12/18",0],["2013/12/19",1],["2013/12/20",1],["2013/12/21",0],["2013/12/22",4],["2013/12/23",0],["2013/12/24",0],["2013/12/25",0],["2013/12/26",1],["2013/12/27",0],["2013/12/28",0],["2013/12/29",0],["2013/12/30",0],["2013/12/31",0],["2014/01/01",0],["2014/01/02",0],["2014/01/03",0],["2014/01/04",0],["2014/01/05",0],["2014/01/06",0],["2014/01/07",0],["2014/01/08",0],["2014/01/09",0],["2014/01/10",0],["2014/01/11",0],["2014/01/12",0],["2014/01/13",0],["2014/01/14",0],["2014/01/15",0],["2014/01/16",0],["2014/01/17",0],["2014/01/18",0],["2014/01/19",0],["2014/01/20",0],["2014/01/21",0],["2014/01/22",0],["2014/01/23",0],["2014/01/24",0],["2014/01/25",0],["2014/01/26",0],["2014/01/27",0],["2014/01/28",0],["2014/01/29",0],["2014/01/30",0],["2014/01/31",0],["2014/02/01",0],["2014/02/02",0],["2014/02/03",0],["2014/02/04",0],["2014/02/05",0],["2014/02/06",0],["2014/02/07",0],["2014/02/08",0],["2014/02/09",0],["2014/02/10",0],["2014/02/11",0],["2014/02/12",0],["2014/02/13",0],["2014/02/14",0],["2014/02/15",0],["2014/02/16",3],["2014/02/17",0],["2014/02/18",0],["2014/02/19",0],["2014/02/20",0],["2014/02/21",0],["2014/02/22",0],["2014/02/23",0],["2014/02/24",0],["2014/02/25",0],["2014/02/26",0],["2014/02/27",0],["2014/02/28",0],["2014/03/01",0],["2014/03/02",0],["2014/03/03",0],["2014/03/04",1],["2014/03/05",0],["2014/03/06",0],["2014/03/07",0],["2014/03/08",0],["2014/03/09",0],["2014/03/10",1],["2014/03/11",0],["2014/03/12",1],["2014/03/13",0],["2014/03/14",0],["2014/03/15",3],["2014/03/16",4],["2014/03/17",1],["2014/03/18",0],["2014/03/19",0],["2014/03/20",0],["2014/03/21",0],["2014/03/22",3],["2014/03/23",1],["2014/03/24",0],["2014/03/25",0],["2014/03/26",0],["2014/03/27",3],["2014/03/28",3],["2014/03/29",0],["2014/03/30",0],["2014/03/31",0],["2014/04/01",0],["2014/04/02",0],["2014/04/03",0],["2014/04/04",0],["2014/04/05",0],["2014/04/06",0],["2014/04/07",0],["2014/04/08",1],["2014/04/09",0],["2014/04/10",0],["2014/04/11",0],["2014/04/12",0],["2014/04/13",0],["2014/04/14",0],["2014/04/15",0],["2014/04/16",0],["2014/04/17",0],["2014/04/18",0],["2014/04/19",4],["2014/04/20",1],["2014/04/21",0],["2014/04/22",2],["2014/04/23",0],["2014/04/24",0],["2014/04/25",0],["2014/04/26",0],["2014/04/27",0],["2014/04/28",0],["2014/04/29",0],["2014/04/30",1],["2014/05/01",0],["2014/05/02",0],["2014/05/03",2],["2014/05/04",1],["2014/05/05",0],["2014/05/06",0],["2014/05/07",0],["2014/05/08",0],["2014/05/09",2],["2014/05/10",0],["2014/05/11",0],["2014/05/12",2],["2014/05/13",0],["2014/05/14",0],["2014/05/15",0],["2014/05/16",1],["2014/05/17",0],["2014/05/18",0],["2014/05/19",2],["2014/05/20",0],["2014/05/21",0],["2014/05/22",0],["2014/05/23",0],["2014/05/24",0],["2014/05/25",0],["2014/05/26",0],["2014/05/27",0],["2014/05/28",2],["2014/05/29",0],["2014/05/30",0],["2014/05/31",0],["2014/06/01",0],["2014/06/02",0],["2014/06/03",0],["2014/06/04",0],["2014/06/05",0],["2014/06/06",0],["2014/06/07",0],["2014/06/08",2],["2014/06/09",0],["2014/06/10",2],["2014/06/11",0],["2014/06/12",0],["2014/06/13",2],["2014/06/14",0],["2014/06/15",1],["2014/06/16",0],["2014/06/17",1],["2014/06/18",0],["2014/06/19",0],["2014/06/20",0],["2014/06/21",0],["2014/06/22",0],["2014/06/23",0],["2014/06/24",0],["2014/06/25",1],["2014/06/26",0],["2014/06/27",5],["2014/06/28",0],["2014/06/29",7],["2014/06/30",0],["2014/07/01",2],["2014/07/02",1],["2014/07/03",0],["2014/07/04",0],["2014/07/05",1],["2014/07/06",2],["2014/07/07",3],["2014/07/08",5],["2014/07/09",5],["2014/07/10",0],["2014/07/11",0],["2014/07/12",0],["2014/07/13",0],["2014/07/14",0],["2014/07/15",0],["2014/07/16",0],["2014/07/17",3],["2014/07/18",0],["2014/07/19",0],["2014/07/20",0],["2014/07/21",0],["2014/07/22",0],["2014/07/23",0],["2014/07/24",0],["2014/07/25",0],["2014/07/26",0],["2014/07/27",0],["2014/07/28",0],["2014/07/29",0],["2014/07/30",0],["2014/07/31",0],["2014/08/01",0],["2014/08/02",0],["2014/08/03",0],["2014/08/04",0],["2014/08/05",0],["2014/08/06",0],["2014/08/07",0],["2014/08/08",0],["2014/08/09",0],["2014/08/10",2],["2014/08/11",0],["2014/08/12",0],["2014/08/13",0],["2014/08/14",0],["2014/08/15",0],["2014/08/16",4],["2014/08/17",0],["2014/08/18",0],["2014/08/19",1],["2014/08/20",0],["2014/08/21",0],["2014/08/22",0],["2014/08/23",0],["2014/08/24",0],["2014/08/25",2],["2014/08/26",0],["2014/08/27",0],["2014/08/28",0],["2014/08/29",0],["2014/08/30",0],["2014/08/31",8]]
\ No newline at end of file
diff --git a/spec/githubchart/svg_spec.rb b/spec/githubchart/svg_spec.rb
deleted file mode 100644
index c3361a7..0000000
--- a/spec/githubchart/svg_spec.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-require 'spec_helper'
-require 'tempfile'
-
-def test_svg(type)
- file = Tempfile.new('svg')
- file.write(GithubChart.new(user: 'akerl').render(type))
- path = file.path
- file.close
- res = `file #{path}`
- file.unlink
- res
-end
-
-describe GithubChart::Chart do
- describe '#render_svg' do
- it 'makes an SVG' do
- expect(test_svg(:svg)).to include('Scalable Vector Graphic')
- end
- end
-
- describe '#render_svg_square' do
- it 'makes an SVG' do
- expect(test_svg(:svg_square)).to include('Scalable Vector Graphic')
- end
- end
-end
diff --git a/spec/githubchart_spec.rb b/spec/githubchart_spec.rb
deleted file mode 100644
index 8f97203..0000000
--- a/spec/githubchart_spec.rb
+++ /dev/null
@@ -1,65 +0,0 @@
-require 'spec_helper'
-
-describe GithubChart do
- describe '#new' do
- it 'creates a new Chart object' do
- expect(GithubChart.new(data: [])).to be_an_instance_of GithubChart::Chart
- end
- end
-
- describe '#supported' do
- it 'lists supported types' do
- expect(GithubChart.supported).to include(:svg)
- end
- end
-
- describe '#supports?' do
- it 'checks for type support' do
- expect(GithubChart.supports?(:svg)).to be_truthy
- expect(GithubChart.supports?(:fish)).to be_falsey
- end
- end
-
- describe GithubChart::Chart do
- it 'has default colors' do
- expect(GithubChart.new(data: []).colors.last).to eql '#196127'
- end
- it 'lets you override the colors' do
- colors = [1, 2, 3, 4, 5]
- expect(GithubChart.new(data: [], colors: colors).colors.last).to eql 5
- end
- it 'lets you pass external data' do
- data = JSON.parse(File.read('spec/examples/input.json'))
- expect(GithubChart.new(data: data).stats).to eql data
- end
- it 'creates a data object when not provided' do
- expect(
- GithubChart.new(user: 'akerl').stats
- ).to be_an_instance_of GithubStats::Data
- end
- end
-
- describe '#render' do
- it 'raises error if render type is unsupported' do
- expect { GithubChart.new(user: 'akerl').render(:dog) }
- .to raise_error(NameError)
- end
- end
-end
-
-describe ::Integer do
- describe '#ordinalize' do
- it 'returns a spoken string for a number' do
- [
- [0, '0'],
- [13, '13th'],
- [21, '21st'],
- [32, '32nd'],
- [43, '43rd'],
- [54, '54th']
- ].each do |i, o|
- expect(i.ordinalize).to eql o
- end
- end
- end
-end
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
deleted file mode 100644
index 42f5852..0000000
--- a/spec/spec_helper.rb
+++ /dev/null
@@ -1,2 +0,0 @@
-require 'rspec'
-require 'githubchart'
diff --git a/src/lib.rs b/src/lib.rs
new file mode 100644
index 0000000..6e57ccd
--- /dev/null
+++ b/src/lib.rs
@@ -0,0 +1,94 @@
+use reqwest;
+use scraper::{Html, Selector};
+
+pub mod svg;
+
+pub struct Chart {
+ stats: Vec<(String, i32)>,
+ colors: Vec<&'static str>,
+}
+
+impl Chart {
+ pub fn new(stats: Vec<(String, i32)>, colors: Option>) -> Self {
+ let default_colors = vec!["#eeeeee", "#c6e48b", "#7bc96f", "#239a3b", "#196127"];
+ Chart {
+ stats,
+ colors: colors.unwrap_or(default_colors),
+ }
+ }
+
+ pub fn render(&self) -> Result {
+ Ok(svg::render_svg(&self))
+ }
+}
+
+pub const COLOR_SCHEMES: &[(&str, &[&str])] = &[
+ (
+ "default",
+ &["#eeeeee", "#c6e48b", "#7bc96f", "#239a3b", "#196127"],
+ ),
+ (
+ "old",
+ &["#eeeeee", "#d6e685", "#8cc665", "#44a340", "#1e6823"],
+ ),
+ (
+ "halloween",
+ &["#EEEEEE", "#FFEE4A", "#FFC501", "#FE9600", "#03001C"],
+ ),
+];
+
+pub fn fetch_github_stats(
+ username: &str,
+) -> Result, Box> {
+ // GitHub's contribution graph data endpoint
+ let url = format!("https://github.com/users/{}/contributions", username);
+
+ // Fetch the HTML content
+ let client = reqwest::blocking::Client::new();
+ let response = client
+ .get(&url)
+ .header("User-Agent", "githubchart-rust")
+ .send()?;
+
+ // Check status code
+ if !response.status().is_success() {
+ return Err(format!(
+ "Failed loading data from GitHub: {} {}",
+ url,
+ response.status()
+ )
+ .into());
+ }
+
+ let html_content = response.text()?;
+ let document = Html::parse_document(&html_content);
+
+ // Select contribution calendar cells
+ let cell_selector = Selector::parse("td.ContributionCalendar-day").unwrap();
+
+ let mut stats = Vec::new();
+
+ for element in document.select(&cell_selector) {
+ if let (Some(date), Some(count_str)) = (
+ element.value().attr("data-date"),
+ element.value().attr("data-level"),
+ ) {
+ if let Ok(count) = count_str.parse::() {
+ // println!("fetch_github_stats > date: {}, count: {}", date, count);
+ stats.push((date.to_string(), count));
+ }
+ }
+ }
+
+ // Sort by date
+ stats.sort_by(|a, b| a.0.cmp(&b.0));
+
+ if stats.is_empty() {
+ println!("Warning: No contribution data found for user {}", username);
+ }
+
+ Ok(stats)
+}
+
+#[cfg(test)]
+mod tests;
diff --git a/src/main.rs b/src/main.rs
new file mode 100644
index 0000000..d3aea0d
--- /dev/null
+++ b/src/main.rs
@@ -0,0 +1,83 @@
+use std::env;
+use std::fs::File;
+use std::io::{self, Write};
+use std::path::Path;
+
+use githubchart::{fetch_github_stats, Chart, COLOR_SCHEMES};
+
+fn main() {
+ let args: Vec = env::args().collect();
+ if args.len() < 2 {
+ eprintln!(
+ "Usage: {} [-u ] [-c ]",
+ args[0]
+ );
+ std::process::exit(1);
+ }
+
+ let mut username = None;
+ let output_file = &args[1];
+ let mut color_scheme = None;
+
+ let mut i = 2;
+ while i < args.len() {
+ match args[i].as_str() {
+ "-u" => {
+ if i + 1 < args.len() {
+ username = Some(args[i + 1].clone());
+ i += 1;
+ } else {
+ eprintln!("Missing value for -u");
+ std::process::exit(1);
+ }
+ }
+ "-c" => {
+ if i + 1 < args.len() {
+ color_scheme = Some(args[i + 1].clone());
+ i += 1;
+ } else {
+ eprintln!("Missing value for -c");
+ std::process::exit(1);
+ }
+ }
+ _ => {
+ eprintln!("Unknown option: {}", args[i]);
+ std::process::exit(1);
+ }
+ }
+ i += 1;
+ }
+
+ let stats = if let Some(username) = username {
+ // Fetch stats from GitHub API
+ match fetch_github_stats(&username) {
+ Ok(stats) => stats,
+ Err(e) => {
+ eprintln!("Error fetching GitHub stats: {}", e);
+ std::process::exit(1);
+ }
+ }
+ } else {
+ eprintln!("Either -u or -i must be provided");
+ std::process::exit(1);
+ };
+
+ let colors = color_scheme
+ .as_ref()
+ .and_then(|scheme| COLOR_SCHEMES.iter().find(|&&(name, _)| name == scheme))
+ .map(|&(_, colors)| colors.to_vec());
+
+ let chart = Chart::new(stats, colors);
+ let svg = chart.render().expect("Failed to render chart");
+
+ if output_file == "-" {
+ io::stdout()
+ .write_all(svg.as_bytes())
+ .expect("Failed to write to stdout");
+ } else {
+ let path = Path::new(output_file);
+ let mut file = File::create(&path).expect("Failed to create output file");
+ file.write_all(svg.as_bytes())
+ .expect("Failed to write to output file");
+ }
+}
diff --git a/src/svg.rs b/src/svg.rs
new file mode 100644
index 0000000..35e9d25
--- /dev/null
+++ b/src/svg.rs
@@ -0,0 +1,114 @@
+use crate::Chart;
+
+const CUBE_SIZE: usize = 12;
+const X_PAD: usize = 27;
+const Y_PAD: usize = 20;
+
+pub fn render_svg(chart: &Chart) -> String {
+ let grid = matrix(&chart.stats);
+
+ let mut svg = String::new();
+ svg.push_str(&format!(
+ r#"");
+ svg
+}
+
+fn matrix(stats: &[(String, i32)]) -> Vec> {
+ let mut grid = vec![vec![Point::default(); 7]; (stats.len() + 6) / 7];
+ for (i, (date, score)) in stats.iter().enumerate() {
+ let x = i / 7;
+ let y = i % 7;
+ grid[x][y] = Point {
+ date: date.clone(),
+ score: *score,
+ };
+ }
+ grid
+}
+
+#[derive(Default, Clone)]
+struct Point {
+ date: String,
+ score: i32,
+}
+
+fn svg_add_points(grid: &[Vec], svg: &mut String, colors: &[&str]) {
+ for (x, row) in grid.iter().enumerate() {
+ for (y, point) in row.iter().enumerate() {
+ if point.score == -1 {
+ continue;
+ }
+ svg.push_str(&format!(
+ r#""#,
+ (x * CUBE_SIZE) + X_PAD,
+ (y * CUBE_SIZE) + Y_PAD,
+ point_color(point.score, colors),
+ point.score,
+ point.date
+ ));
+ }
+ }
+}
+
+fn svg_add_weekdays(svg: &mut String) {
+ let weekdays = ["Mon", "Wed", "Fri"];
+ for (i, &day) in weekdays.iter().enumerate() {
+ svg.push_str(&format!(
+ r#"{}"#,
+ (CUBE_SIZE * (i * 2 + 1)) + 28,
+ day
+ ));
+ }
+}
+
+fn svg_add_months(svg: &mut String, stats: &[(String, i32)]) {
+ if stats.is_empty() {
+ return;
+ }
+
+ let months = [
+ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec",
+ ];
+
+ // Parse the first date to get starting month
+ let start_date = &stats[0].0; // Format: "YYYY-MM-DD"
+ let start_month: usize = start_date[5..7].parse().unwrap_or(1);
+
+ let mut current_month = start_month - 1; // 0-based index
+ let mut last_x = 0;
+
+ // Add up to 12 month labels
+ for i in 0..12 {
+ let x = (CUBE_SIZE * (i * 30) / 7) + X_PAD;
+
+ // Only add label if it's significantly far from the last one
+ if i == 0 || x >= last_x + 40 {
+ svg.push_str(&format!(
+ r#"{}"#,
+ x,
+ months[current_month]
+ ));
+ last_x = x;
+ }
+
+ current_month = (current_month + 1) % 12;
+ }
+}
+
+fn point_color<'a>(score: i32, colors: &'a [&str]) -> &'a str {
+ let index = match score {
+ 0 => 0,
+ 1..=3 => 1,
+ 4..=6 => 2,
+ 7..=9 => 3,
+ _ => 4,
+ };
+ colors.get(index).unwrap_or(&colors[0])
+}
diff --git a/src/tests.rs b/src/tests.rs
new file mode 100644
index 0000000..aa92fa6
--- /dev/null
+++ b/src/tests.rs
@@ -0,0 +1,65 @@
+#[cfg(test)]
+mod tests {
+ use crate::{Chart, COLOR_SCHEMES};
+
+ fn sample_stats() -> Vec<(String, i32)> {
+ vec![
+ ("2024-01-01".to_string(), 0),
+ ("2024-01-02".to_string(), 1),
+ ("2024-01-03".to_string(), 4),
+ ("2024-01-04".to_string(), 7),
+ ("2024-01-05".to_string(), 10),
+ ]
+ }
+
+ #[test]
+ fn test_chart_creation() {
+ let stats = sample_stats();
+ let chart = Chart::new(stats.clone(), None);
+ assert_eq!(chart.stats, stats);
+ assert_eq!(chart.colors.len(), 5);
+ }
+
+ #[test]
+ fn test_chart_with_custom_colors() {
+ let stats = sample_stats();
+ let colors = Some(COLOR_SCHEMES[2].1.to_vec()); // Halloween scheme
+ let chart = Chart::new(stats, colors.clone());
+ assert_eq!(chart.colors, colors.unwrap());
+ }
+
+ #[test]
+ fn test_svg_rendering() {
+ let stats = sample_stats();
+ let chart = Chart::new(stats, None);
+ let svg = chart.render().unwrap();
+
+ // Basic SVG structure
+ assert!(svg.starts_with("