commit 6d663210e160ecd832d78bf8c60b4ba4534584d0 Author: Steven Date: Fri Jul 28 20:56:30 2023 -0400 Inital POC diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ea8c4bf --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/target diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..d7a29a5 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,1117 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "addr2line" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4fa78e18c64fce05e902adecd7a5eed15a5e0a3439f7b0e169f0252214865e3" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "backtrace" +version = "0.3.68" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4319208da049c43661739c5fade2ba182f09d1dc2299b32298d3a31692b17e12" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + +[[package]] +name = "base64" +version = "0.21.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "630be753d4e58660abd17930c71b647fe46c27ea6b63cc59e1e3851406972e42" + +[[package]] +name = "bumpalo" +version = "3.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" + +[[package]] +name = "bytes" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" + +[[package]] +name = "cc" +version = "1.0.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" + +[[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.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" + +[[package]] +name = "encoding_rs" +version = "0.8.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071a31f4ee85403370b58aca746f01041ede6f0da2730960ad001edc2b71b394" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "errno" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" +dependencies = [ + "errno-dragonfly", + "libc", + "windows-sys", +] + +[[package]] +name = "errno-dragonfly" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "fastrand" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764" + +[[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.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "futures-channel" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" +dependencies = [ + "futures-core", +] + +[[package]] +name = "futures-core" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" + +[[package]] +name = "futures-sink" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" + +[[package]] +name = "futures-task" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" + +[[package]] +name = "futures-util" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" +dependencies = [ + "futures-core", + "futures-task", + "pin-project-lite", + "pin-utils", +] + +[[package]] +name = "gimli" +version = "0.27.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" + +[[package]] +name = "h2" +version = "0.3.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97ec8491ebaf99c8eaa73058b045fe58073cd6be7f596ac993ced0b0a0c01049" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "hermit-abi" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" + +[[package]] +name = "http" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +dependencies = [ + "bytes", + "http", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" + +[[package]] +name = "httpdate" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" + +[[package]] +name = "hyper" +version = "0.14.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" +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 = "idna" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown", +] + +[[package]] +name = "ipnet" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6" + +[[package]] +name = "itoa" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" + +[[package]] +name = "js-sys" +version = "0.3.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "libc" +version = "0.2.147" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" + +[[package]] +name = "linux-raw-sys" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09fc20d2ca12cb9f044c93e3bd6d32d523e6e2ec3db4f7b2939cd99026ecd3f0" + +[[package]] +name = "lock_api" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" + +[[package]] +name = "memchr" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" + +[[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.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +dependencies = [ + "adler", +] + +[[package]] +name = "mio" +version = "0.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" +dependencies = [ + "libc", + "wasi", + "windows-sys", +] + +[[package]] +name = "mtg_seller_bot" +version = "0.1.0" +dependencies = [ + "reqwest", + "serde", + "serde_json", + "tokio", +] + +[[package]] +name = "native-tls" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" +dependencies = [ + "lazy_static", + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + +[[package]] +name = "num_cpus" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +dependencies = [ + "hermit-abi", + "libc", +] + +[[package]] +name = "object" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bda667d9f2b5051b8833f59f3bf748b28ef54f850f4fcb389a252aa383866d1" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" + +[[package]] +name = "openssl" +version = "0.10.55" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "345df152bc43501c5eb9e4654ff05f794effb78d4efe3d53abc158baddc0703d" +dependencies = [ + "bitflags 1.3.2", + "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", +] + +[[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.90" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "374533b0e45f3a7ced10fcaeccca020e66656bc03dac384f852e4e5a7a8104a6" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets", +] + +[[package]] +name = "percent-encoding" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" + +[[package]] +name = "pin-project-lite" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c40d25201921e5ff0c862a505c6557ea88568a4e3ace775ab55e93f2f4f9d57" + +[[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.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" + +[[package]] +name = "proc-macro2" +version = "1.0.66" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50f3b39ccfb720540debaa0164757101c08ecb8d326b15358ce76a62c7e85965" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "redox_syscall" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +dependencies = [ + "bitflags 1.3.2", +] + +[[package]] +name = "reqwest" +version = "0.11.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cde824a14b7c14f85caff81225f411faacc04a2013f41670f41443742b1c1c55" +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", + "serde", + "serde_json", + "serde_urlencoded", + "tokio", + "tokio-native-tls", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "winreg", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" + +[[package]] +name = "rustix" +version = "0.38.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a962918ea88d644592894bc6dc55acc6c0956488adcebbfb6e273506b7fd6e5" +dependencies = [ + "bitflags 2.3.3", + "errno", + "libc", + "linux-raw-sys", + "windows-sys", +] + +[[package]] +name = "ryu" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" + +[[package]] +name = "schannel" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" +dependencies = [ + "windows-sys", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "security-framework" +version = "2.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "serde" +version = "1.0.178" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60363bdd39a7be0266a520dab25fdc9241d2f987b08a01e01f0ec6d06a981348" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.178" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f28482318d6641454cb273da158647922d1be6b5a2fcc6165cd89ebdd7ed576b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.104" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "076066c5f1078eac5b722a31827a8832fe108bed65dfa75e233c89f8206e976c" +dependencies = [ + "itoa", + "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 = "signal-hook-registry" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +dependencies = [ + "libc", +] + +[[package]] +name = "slab" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smallvec" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" + +[[package]] +name = "socket2" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "syn" +version = "2.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b60f673f44a8255b9c8c657daf66a596d435f2da81a555b06dc644d080ba45e0" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "tempfile" +version = "3.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5486094ee78b2e5038a6382ed7645bc084dc2ec433426ca4c3cb61e2007b8998" +dependencies = [ + "cfg-if", + "fastrand", + "redox_syscall", + "rustix", + "windows-sys", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tokio" +version = "1.29.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "532826ff75199d5833b9d2c5fe410f29235e25704ee5f0ef599fb51c21f4a4da" +dependencies = [ + "autocfg", + "backtrace", + "bytes", + "libc", + "mio", + "num_cpus", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "windows-sys", +] + +[[package]] +name = "tokio-macros" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[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.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", + "tracing", +] + +[[package]] +name = "tower-service" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" + +[[package]] +name = "tracing" +version = "0.1.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +dependencies = [ + "cfg-if", + "pin-project-lite", + "tracing-core", +] + +[[package]] +name = "tracing-core" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" +dependencies = [ + "once_cell", +] + +[[package]] +name = "try-lock" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" + +[[package]] +name = "unicode-bidi" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" + +[[package]] +name = "unicode-ident" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" + +[[package]] +name = "unicode-normalization" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "url" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[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.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" +dependencies = [ + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" + +[[package]] +name = "web-sys" +version = "0.3.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.48.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" + +[[package]] +name = "winreg" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" +dependencies = [ + "winapi", +] diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..a333e87 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,12 @@ +[package] +name = "mtg_seller_bot" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +reqwest = { version = "0.11.18", features = ["json"] } +serde = { version = "1.0.178", features = ["derive"]} +serde_json = "1.0.104" +tokio = {version = "1.29.1", features = ["full"]} diff --git a/cards.json b/cards.json new file mode 100644 index 0000000..70d8b6c --- /dev/null +++ b/cards.json @@ -0,0 +1,636 @@ +{ + "cards": [ + {"name":"castle vantress","count":2}, + {"name":"snow-covered island","count":1}, + {"name":"beacon of tomorrows","count":1}, + {"name":"oran-rief the vastwood","count":1}, + {"name":"mosswort bridge","count":1}, + {"name":"snow-covered forest","count":1}, + {"name":"castle embereth","count":1}, + {"name":"sokenzan, crucible of defiance","count":1}, + {"name":"spinerock knoll","count":1}, + {"name":"yavimaya coast","count":1}, + {"name":"temple of deceit","count":1}, + {"name":"plaza of harmony","count":1}, + {"name":"vault of champions","count":1}, + {"name":"overgrown farmland","count":1}, + {"name":"deserted beach","count":1}, + {"name":"exotic orchard","count":2}, + {"name":"spectator seating","count":1}, + {"name":"wooded bastion","count":1}, + {"name":"flooded grove","count":1}, + {"name":"twilight mire","count":2}, + {"name":"overgrown tomb","count":1}, + {"name":"breeding pool","count":1}, + {"name":"cinder glade","count":2}, + {"name":"indatha triome","count":1}, + {"name":"mossfire valley","count":1}, + {"name":"haunted ridge","count":1}, + {"name":"stomping ground","count":1}, + {"name":"temple of epiphany","count":2}, + {"name":"temple of triumph","count":1}, + {"name":"needle spires","count":1}, + {"name":"kessig wolf run","count":1}, + {"name":"shadowblood ridge","count":1}, + {"name":"desolate lighthouse","count":1}, + {"name":"blinkmoth nexus","count":1}, + {"name":"blast zone","count":1}, + {"name":"mobilized district","count":2}, + {"name":"lotus field","count":1}, + {"name":"academy ruins","count":1}, + {"name":"command beacon","count":1}, + {"name":"drownyard temple","count":1}, + {"name":"eiganjo, seat of the empire","count":1}, + {"name":"windbrisk heights","count":1}, + {"name":"snow-covered swamp","count":1}, + {"name":"snow-covered plains","count":2}, + {"name":"walking ballista","count":1}, + {"name":"sundering titan","count":2}, + {"name":"phyrexian revoker","count":1}, + {"name":"akroan horse","count":1}, + {"name":"marching duodrone","count":1}, + {"name":"solemn simulacrum","count":1}, + {"name":"bladegriff prototype","count":1}, + {"name":"myr battlesphere","count":1}, + {"name":"metalwork colossus","count":1}, + {"name":"benthic biomancer","count":1}, + {"name":"sphinx of foresight","count":1}, + {"name":"body of knowledge","count":1}, + {"name":"sakashima's protege","count":1}, + {"name":"lunar mystic","count":1}, + {"name":"fae of wishes","count":1}, + {"name":"eon frolicker","count":1}, + {"name":"nascent metamorph","count":1}, + {"name":"scourge of fleets","count":1}, + {"name":"rattlechains","count":1}, + {"name":"dungeon geists","count":2}, + {"name":"prosperous thief","count":1}, + {"name":"kheru spellsnatcher","count":1}, + {"name":"dimensional infiltrator","count":1}, + {"name":"serpent of yawning depths","count":1}, + {"name":"enigma thief","count":1}, + {"name":"poppet stitcher","count":1}, + {"name":"master of etherium","count":1}, + {"name":"omnispell adept","count":1}, + {"name":"inkwell leviathan","count":1}, + {"name":"haldan, avid arcanist","count":1}, + {"name":"sludge monster","count":1}, + {"name":"spark double","count":1}, + {"name":"patrician geist","count":1}, + {"name":"niblis of frost","count":1}, + {"name":"laboratory drudge","count":1}, + {"name":"illithid harvester","count":3}, + {"name":"gale, waterdeep prodigy","count":1}, + {"name":"talrand, sky summoner","count":1}, + {"name":"tomb of horrors adventurer","count":1}, + {"name":"imoen, mystic trickster","count":1}, + {"name":"eligeth, crossroads augur","count":1}, + {"name":"guardians of oboro","count":5}, + {"name":"futurist operative","count":3}, + {"name":"tameshi, reality architect","count":2}, + {"name":"aetherling","count":2}, + {"name":"moonsnare specialist","count":7}, + {"name":"mirror-mad phantasm","count":2}, + {"name":"hidetsugu, devouring chaos","count":1}, + {"name":"ruin raider","count":1}, + {"name":"nashi, moon sage's scion","count":1}, + {"name":"myojin of grim betrayal","count":1}, + {"name":"nighthowler","count":1}, + {"name":"ogre slumlord","count":1}, + {"name":"massacre girl","count":1}, + {"name":"salvage titan","count":1}, + {"name":"sepulchral primordial","count":1}, + {"name":"death's shadow","count":1}, + {"name":"murderous rider","count":1}, + {"name":"piper of the swarm","count":1}, + {"name":"demon of loathing","count":1}, + {"name":"gravewaker","count":1}, + {"name":"despoiler of souls","count":1}, + {"name":"soul of innistrad","count":1}, + {"name":"silumgar assassin","count":1}, + {"name":"defiant bloodlord","count":1}, + {"name":"guul draz overseer","count":1}, + {"name":"spawn of mayhem","count":1}, + {"name":"nezumi prowler","count":1}, + {"name":"pestilence demon","count":1}, + {"name":"graveyard trespasser","count":1}, + {"name":"baneblade scoundrel","count":1}, + {"name":"calculating lich","count":1}, + {"name":"dread presence","count":1}, + {"name":"safana, calimport cutthroat","count":1}, + {"name":"viconia, drow apostate","count":1}, + {"name":"shadowheart, dark justiciar","count":2}, + {"name":"sivriss, nightmare speaker","count":1}, + {"name":"sarevok, deathbringer","count":1}, + {"name":"solemn doomguide","count":1}, + {"name":"ravenloft adventurer","count":1}, + {"name":"dokuchi silencer","count":1}, + {"name":"opposition agent","count":1}, + {"name":"oathsworn knight","count":1}, + {"name":"vilis, broker of blood","count":1}, + {"name":"sengir, the dark baron","count":1}, + {"name":"biting-palm ninja","count":2}, + {"name":"blade of the oni","count":2}, + {"name":"mukotai ambusher","count":3}, + {"name":"dokuchi shadow-walker","count":3}, + {"name":"elvish dreadlord","count":2}, + {"name":"nezumi bladeblesser","count":2}, + {"name":"intellect devourer","count":2}, + {"name":"shady traveler","count":5}, + {"name":"champion of stray souls","count":2}, + {"name":"inkrise infiltrator","count":5}, + {"name":"daring archaeologist","count":1}, + {"name":"norika yamazaki, the poet","count":2}, + {"name":"eiganjo exemplar","count":2}, + {"name":"lae'zel vlaakith's champion","count":1}, + {"name":"harper recruiter","count":1}, + {"name":"kyodai, soul of kamigawa","count":1}, + {"name":"ancient gold dragon","count":1}, + {"name":"ellyn harbreeze, busybody","count":1}, + {"name":"weathered wayfarer","count":1}, + {"name":"michiko konda, truth seeker","count":1}, + {"name":"brutal cathar","count":2}, + {"name":"sungold sentinel","count":1}, + {"name":"keeper of the accord","count":1}, + {"name":"toolcraft exemplar","count":1}, + {"name":"high sentinels of arashin","count":1}, + {"name":"esper sentinel","count":1}, + {"name":"teshar, ancestor's apostle","count":1}, + {"name":"acclaimed contender","count":1}, + {"name":"angelic guardian","count":1}, + {"name":"archon of coronation","count":1}, + {"name":"faerie guidemother","count":1}, + {"name":"giant killer","count":2}, + {"name":"god-eternal oketra","count":1}, + {"name":"taranika, akroan veteran","count":1}, + {"name":"victory's envoy","count":1}, + {"name":"hanged executioner","count":1}, + {"name":"majestic auricorn","count":1}, + {"name":"loxodon lifechanter","count":2}, + {"name":"tomik, distinguished advokist","count":1}, + {"name":"wingmate roc","count":1}, + {"name":"avacyn, angel of hope","count":1}, + {"name":"zetalpa, primal dawn","count":1}, + {"name":"livio, oathsworn sentinel","count":1}, + {"name":"highcliff felidar","count":1}, + {"name":"sun titan","count":1}, + {"name":"trove warden","count":1}, + {"name":"kytheon's irregulars","count":1}, + {"name":"munda's vanguard","count":1}, + {"name":"light of the legion","count":1}, + {"name":"scion of vitu-ghazi","count":1}, + {"name":"angel of deliverance","count":1}, + {"name":"stonehewer giant","count":1}, + {"name":"hero of goma fada","count":2}, + {"name":"serra's guardian","count":2}, + {"name":"blade-blizzard kitsune","count":2}, + {"name":"sunblade samurai","count":3}, + {"name":"candlegrove witch","count":4}, + {"name":"imperial subduer","count":2}, + {"name":"light-paws, emperor's voice","count":3}, + {"name":"sephara, sky's blade","count":2}, + {"name":"doomgape","count":1}, + {"name":"izoni,thousand-eyed","count":1}, + {"name":"kagha, shadow archdruid","count":1}, + {"name":"baba lysaga, night witch","count":1}, + {"name":"silver-fur, master","count":1}, + {"name":"satoru umezawa","count":2}, + {"name":"wilhelt, the rotcleaver","count":1}, + {"name":"consuming aberration","count":1}, + {"name":"sygg, river cutthroat","count":1}, + {"name":"notion thief","count":1}, + {"name":"anowon, the ruin thief","count":1}, + {"name":"fathom feeder","count":1}, + {"name":"jon irenicus, shattered one","count":1}, + {"name":"rilsa rael, kingpin","count":1}, + {"name":"boros reckoner","count":1}, + {"name":"swiftblade vindicator","count":3}, + {"name":"angelic captain","count":4}, + {"name":"blade historian","count":1}, + {"name":"raiyuu, storm's edge","count":2}, + {"name":"risona, asari commander","count":1}, + {"name":"aurelia, the warleader","count":1}, + {"name":"agrus kos, wojek veteran","count":1}, + {"name":"zirda, the dawnwaker","count":1}, + {"name":"razia, boros archangel","count":1}, + {"name":"munda, ambush leader","count":2}, + {"name":"commander liara portyr","count":3}, + {"name":"anya, merciless angel","count":1}, + {"name":"ivorytusk fortress","count":1}, + {"name":"wild beastmaster","count":1}, + {"name":"gilanra, caller of wirewood","count":1}, + {"name":"voracious hydra","count":1}, + {"name":"kami of transience","count":2}, + {"name":"dire-strain brawler","count":1}, + {"name":"wing shredder","count":1}, + {"name":"treeshaker chimera","count":1}, + {"name":"wicked wolf","count":1}, + {"name":"dire-strain demolisher","count":1}, + {"name":"vengevine","count":1}, + {"name":"terastodon","count":1}, + {"name":"kogla, the titan ape","count":1}, + {"name":"ripjaw raptor","count":1}, + {"name":"wakeroot elemental","count":1}, + {"name":"earthshaker giant","count":1}, + {"name":"ghalta, primal hunger","count":1}, + {"name":"ravenous gigantotherium","count":1}, + {"name":"glademuse","count":1}, + {"name":"heir of the ancient fang","count":1}, + {"name":"oviya pashiri, sage lifecrafter","count":1}, + {"name":"kodama of the east tree","count":1}, + {"name":"immaculate magistrate","count":1}, + {"name":"skanos, dragonheart","count":1}, + {"name":"erinis, gloom stalker","count":2}, + {"name":"wilson, refined grizzly","count":1}, + {"name":"halsin, emerald archdruid","count":1}, + {"name":"hound tamer","count":1}, + {"name":"rampaging baloths","count":1}, + {"name":"multani, yavimaya's avatar","count":1}, + {"name":"sylvan advocate","count":1}, + {"name":"kappa tech-wrecker","count":1}, + {"name":"waker of the wilds","count":1}, + {"name":"fang of shigeki","count":1}, + {"name":"jaheira, friend of the forest","count":1}, + {"name":"biowaste blob","count":1}, + {"name":"apex devastator","count":1}, + {"name":"bristling hydra","count":1}, + {"name":"renegade krasis","count":1}, + {"name":"architect of the untamed","count":1}, + {"name":"cylian sunsinger","count":1}, + {"name":"myojin of towering might","count":1}, + {"name":"deranged outcast","count":1}, + {"name":"soul of zendikar","count":1}, + {"name":"dawnhart rejuvenator","count":4}, + {"name":"jukai trainee","count":4}, + {"name":"bird admirer","count":4}, + {"name":"outland liberator","count":2}, + {"name":"dawnhart mentor","count":2}, + {"name":"noble hierarch","count":2}, + {"name":"tireless hauler","count":2}, + {"name":"warden of the first tree","count":2}, + {"name":"weaver of harmony","count":2}, + {"name":"coiling stalker","count":3}, + {"name":"spring-leaf avenger","count":3}, + {"name":"dryad of the ilysian grove","count":3}, + {"name":"kura, the boundless sky","count":2}, + {"name":"terror of mount velus","count":1}, + {"name":"dreadhorde arcanist","count":1}, + {"name":"marauding raptor","count":1}, + {"name":"fiendish duo","count":1}, + {"name":"akoum hellkite","count":1}, + {"name":"captain lannery storm","count":1}, + {"name":"phoenix of ash","count":1}, + {"name":"sin prodder","count":1}, + {"name":"legion loyalist","count":1}, + {"name":"immolation shaman","count":1}, + {"name":"charmbreaker devils","count":1}, + {"name":"goblin dark-dwellers","count":1}, + {"name":"dualcaster mage","count":1}, + {"name":"smoldering egg","count":1}, + {"name":"lathliss, dragon queen","count":1}, + {"name":"rionya, fire dancer","count":1}, + {"name":"amplifire","count":1}, + {"name":"scrap welder","count":1}, + {"name":"falkenrath pit fighter","count":1}, + {"name":"fury","count":1}, + {"name":"karlach, fury of avernus","count":1}, + {"name":"gut, true soul zealot","count":1}, + {"name":"ogre-head helm","count":1}, + {"name":"lizard blades","count":1}, + {"name":"immortal phoenix","count":1}, + {"name":"rekindling phoenix","count":1}, + {"name":"rageblood shaman","count":1}, + {"name":"dragon-style twins","count":1}, + {"name":"labyrinth champion","count":1}, + {"name":"magus of the moon","count":1}, + {"name":"rowan's stalwarts","count":2}, + {"name":"akki ronin","count":3}, + {"name":"monastery swiftspear","count":1}, + {"name":"fangblade brigand","count":1}, + {"name":"gargadon","count":1}, + {"name":"reinforced ronin","count":1}, + {"name":"combustible gearhulk","count":1}, + {"name":"thundering raiju","count":1}, + {"name":"etali, primal storm","count":1}, + {"name":"anax, hardened in the forge","count":1}, + {"name":"fervent champion","count":1}, + {"name":"lovisa coldeyes","count":1}, + {"name":"grim lavamancer","count":1}, + {"name":"ashcloud phoenix","count":1}, + {"name":"flame-wreathed phoenix","count":1}, + {"name":"flameblast dragon","count":1}, + {"name":"geode rager","count":1}, + {"name":"goro-goro, disciple of ryusei","count":1}, + {"name":"verix bladewing","count":1}, + {"name":"akoum firebird","count":1}, + {"name":"moonveil regent","count":1}, + {"name":"sunstreak phoenix","count":1}, + {"name":"hoard-smelter dragon","count":2}, + {"name":"shivan dragon","count":4}, + {"name":"krenko, tin street kingpin","count":2}, + {"name":"drakuseth, maw of flames","count":2}, + {"name":"harvesttide infiltrator","count":5}, + {"name":"tavern ruffian","count":4}, + {"name":"glint-horn buccaneer","count":2}, + {"name":"upriser renegade","count":2}, + {"name":"peerless samurai","count":2}, + {"name":"village watch","count":2}, + {"name":"heiko yamazaki, the general","count":2}, + {"name":"legion warboss","count":2}, + {"name":"xyris, the writhing storm","count":1}, + {"name":"averna, the chaos bloom","count":1}, + {"name":"kalamax, the stormsire","count":1}, + {"name":"bane, lord of darkness","count":2}, + {"name":"myrkul, lord of bones","count":1}, + {"name":"Bhaal, Lord of Murder","count":2}, + {"name":"korvold, fae-cursed king","count":1}, + {"name":"gnostro, voice of the crags","count":1}, + {"name":"dynaheir, invoker adept","count":1}, + {"name":"zedruu the greathearted","count":1}, + {"name":"yarok, the desecrated","count":1}, + {"name":"nine-fingers keene","count":1}, + {"name":"sidisi, brood tyrant","count":1}, + {"name":"mazzy, truesword paladin","count":1}, + {"name":"jared carthalion, true heir","count":1}, + {"name":"obuun, mul daya ancestor","count":1}, + {"name":"isshin, two heavens as one","count":1}, + {"name":"jan jansen, chaos, crafter","count":1}, + {"name":"zevlor, elturel exile","count":2}, + {"name":"the kami war","count":1}, + {"name":"niv-mizzet reborn","count":1}, + {"name":"jhoira, weatherlight captain","count":1}, + {"name":"zara, renegade recruiter","count":1}, + {"name":"brudiclad, telchor engineer","count":2}, + {"name":"melek izzet paragon","count":1}, + {"name":"jhoira of the ghitu","count":1}, + {"name":"lozhan, dragons' legacy","count":2}, + {"name":"djinn illuminatus","count":1}, + {"name":"dreadhorde butcher","count":1}, + {"name":"falkenrath aristocrat","count":1}, + {"name":"fulminator mage","count":1}, + {"name":"underworld cerberus","count":1}, + {"name":"tymaret, the murder king","count":1}, + {"name":"dust stalker","count":1}, + {"name":"astarion, the decadent","count":1}, + {"name":"minthara, merciless soul","count":1}, + {"name":"greasefang, okiba boss","count":2}, + {"name":"orah, skyclave hierophant","count":1}, + {"name":"mina and denn, wildborn","count":2}, + {"name":"ruric thar, the unbowed","count":2}, + {"name":"vexing shusher","count":1}, + {"name":"gallia of the endless dance","count":1}, + {"name":"borborygmos enraged","count":1}, + {"name":"living twister","count":1}, + {"name":"omnath, locus of rage","count":1}, + {"name":"pako arcane retriever","count":1}, + {"name":"wort, the raidmother","count":1}, + {"name":"savageborn hydra","count":1}, + {"name":"ravager wurm","count":1}, + {"name":"oji, the exquisite blade","count":1}, + {"name":"meddling mage","count":1}, + {"name":"noyan dar, roil shaper","count":3}, + {"name":"lavinia of the tenth","count":2}, + {"name":"daxos of meletis","count":1}, + {"name":"dream trawler","count":1}, + {"name":"deputy of detention","count":1}, + {"name":"isperia, supreme judge","count":1}, + {"name":"korlessa, scale singer","count":1}, + {"name":"alaundo the seer","count":1}, + {"name":"roalesk, apex hybrid","count":1}, + {"name":"zegana, utopian speaker","count":2}, + {"name":"rashmi, eternities crafter","count":1}, + {"name":"slogurk, the overslime","count":1}, + {"name":"shardless agent","count":1}, + {"name":"dawnhart wardens","count":2}, + {"name":"emmara tandris","count":1}, + {"name":"tolsimir, friend to wolves","count":1}, + {"name":"kyler, sigardian emissary","count":1}, + {"name":"lathiel, the bounteous dawn","count":1}, + {"name":"rhys the redeemed","count":1}, + {"name":"katilda, dawnhart prime","count":1}, + {"name":"risen sanctuary","count":1}, + {"name":"duke ulder ravengard","count":1}, + {"name":"spirit-sister's call","count":1}, + {"name":"oath of kaya","count":2}, + {"name":"invocation of saint traft","count":2}, + {"name":"fevered visions","count":2}, + {"name":"sultai ascendancy","count":1}, + {"name":"abzan ascendancy","count":1}, + {"name":"mardu ascendancy","count":1}, + {"name":"agent of the iron throne","count":1}, + {"name":"cultist of the absolute","count":1}, + {"name":"scion of halaster","count":1}, + {"name":"curse of leeches","count":1}, + {"name":"phyrexian scriptures","count":1}, + {"name":"daxos's torment","count":1}, + {"name":"descent into madness","count":1}, + {"name":"wound reflection","count":1}, + {"name":"liliana's mastery","count":1}, + {"name":"the meathook massacre","count":1}, + {"name":"master chef","count":1}, + {"name":"the dragon-kami reborn","count":2}, + {"name":"predatory urge","count":1}, + {"name":"oath of the ancient wood","count":1}, + {"name":"aid from the cowl","count":1}, + {"name":"unnatural growth","count":1}, + {"name":"rites of flourishing","count":1}, + {"name":"the mending of dominaria","count":1}, + {"name":"abundance","count":1}, + {"name":"mana reflection","count":1}, + {"name":"enchantress's presence","count":1}, + {"name":"collapsing borders","count":4}, + {"name":"court of ire","count":1}, + {"name":"sneak attack","count":1}, + {"name":"ion storm","count":1}, + {"name":"curse of shaken faith","count":1}, + {"name":"leyline of combustion","count":1}, + {"name":"blood moon","count":1}, + {"name":"tavern brawler","count":1}, + {"name":"popular entertainer","count":1}, + {"name":"descent into avernus","count":1}, + {"name":"street urchin","count":1}, + {"name":"blood sun","count":1}, + {"name":"domestication","count":1}, + {"name":"shark typhoon","count":1}, + {"name":"prism array","count":1}, + {"name":"shameless charlatan","count":1}, + {"name":"kindred discovery","count":1}, + {"name":"curse of surveillance","count":1}, + {"name":"court of cunning","count":1}, + {"name":"swarm intelligence","count":1}, + {"name":"legion loyalty","count":1}, + {"name":"noble heritage","count":1}, + {"name":"happily ever after","count":1}, + {"name":"always watching","count":3}, + {"name":"martial law","count":1}, + {"name":"court of grace","count":1}, + {"name":"together forever","count":1}, + {"name":"quarantine field","count":1}, + {"name":"legion's landing","count":1}, + {"name":"sigarda's splendor","count":1}, + {"name":"tamiyo, compleated sage","count":1}, + {"name":"angrath, minotaur pirate","count":1}, + {"name":"domri, anarch of bolas","count":1}, + {"name":"geyadrone dihada","count":1}, + {"name":"nicol bolas, dragon-god","count":1}, + {"name":"kaito, shizuki","count":1}, + {"name":"ugin, the ineffable","count":1}, + {"name":"wrenn and seven","count":1}, + {"name":"vivien, champion of the wilds","count":1}, + {"name":"nissa, who shakes the world","count":2}, + {"name":"sarkhan the masterless","count":2}, + {"name":"jeska, thrice reborn","count":1}, + {"name":"jace, architect of thought","count":1}, + {"name":"anguished unmaking","count":1}, + {"name":"artifact mutation","count":1}, + {"name":"master warcraft","count":1}, + {"name":"siphon insight","count":1}, + {"name":"spinal embrace","count":1}, + {"name":"dragon shift","count":1}, + {"name":"firemind's foresight","count":1}, + {"name":"dromoka's command","count":1}, + {"name":"astarion's thirst","count":1}, + {"name":"march of wretched sorrow","count":2}, + {"name":"vampiric tutor","count":1}, + {"name":"return of the wildspeaker","count":2}, + {"name":"kamahl's will","count":1}, + {"name":"curious herd","count":1}, + {"name":"strength of the tajuru","count":1}, + {"name":"fated intervention","count":1}, + {"name":"march of burgeoning life","count":1}, + {"name":"awakening of vitu-ghazi","count":1}, + {"name":"once upon a time","count":1}, + {"name":"faithless salvaging","count":1}, + {"name":"chaos warp","count":1}, + {"name":"deflecting swat","count":1}, + {"name":"magmaquake","count":1}, + {"name":"commune with lava","count":1}, + {"name":"starstorm","count":1}, + {"name":"comet storm","count":1}, + {"name":"epiphany at the drownyard","count":1}, + {"name":"polymorphous rush","count":1}, + {"name":"engulf the shore","count":1}, + {"name":"icy blast","count":1}, + {"name":"decoy gambit","count":1}, + {"name":"march of swirling mist","count":2}, + {"name":"gale's redirection","count":1}, + {"name":"march of otherworldly light","count":2}, + {"name":"eerie interlude","count":1}, + {"name":"ignite the beacon","count":2}, + {"name":"revel in silence","count":1}, + {"name":"lae'zel's acrobatics","count":1}, + {"name":"time sieve","count":1}, + {"name":"aetherflux reservoir","count":1}, + {"name":"pyxis of pandemonium","count":1}, + {"name":"chaos wand","count":2}, + {"name":"corrupted grafstone","count":1}, + {"name":"silent gravestone","count":1}, + {"name":"tower of calamities","count":1}, + {"name":"haunted plate mail","count":1}, + {"name":"eye of doom","count":1}, + {"name":"multiclass baldric","count":1}, + {"name":"mighty servant of leuk-o","count":1}, + {"name":"moss diamond","count":3}, + {"name":"cloak of the bat","count":2}, + {"name":"sky diamond","count":1}, + {"name":"charcoal diamond","count":1}, + {"name":"decanter of endless water","count":1}, + {"name":"thran temporal gateway","count":1}, + {"name":"stonespeaker crystal","count":1}, + {"name":"seer's sundial","count":2}, + {"name":"loxodon warhammer","count":1}, + {"name":"vanquisher's banner","count":1}, + {"name":"junkyo bell","count":1}, + {"name":"helvault","count":1}, + {"name":"obelisk of urd","count":1}, + {"name":"blackblade reforged","count":1}, + {"name":"mesmeric orb","count":1}, + {"name":"ratchet bomb","count":1}, + {"name":"boneyard","count":1}, + {"name":"scytheclaw","count":1}, + {"name":"eater of virtue","count":2}, + {"name":"nevinyrral's disk","count":1}, + {"name":"pithing needle","count":1}, + {"name":"twinning staff","count":1}, + {"name":"rings of brighthearth","count":1}, + {"name":"surgehacker mech","count":1}, + {"name":"conjurer's closet","count":1}, + {"name":"mask of griselbrand","count":1}, + {"name":"mukotai soulripper","count":1}, + {"name":"whispersteel dagger","count":1}, + {"name":"mizzium tank","count":1}, + {"name":"lavabrink floodgates","count":1}, + {"name":"silent submersible","count":1}, + {"name":"parhelion II","count":1}, + {"name":"kaya's wrath","count":1}, + {"name":"obzedat's aid","count":1}, + {"name":"revival/revenge","count":1}, + {"name":"angrath's fury","count":2}, + {"name":"bring to light","count":1}, + {"name":"camaraderie","count":1}, + {"name":"reap the past","count":1}, + {"name":"dire-strain rampage","count":1}, + {"name":"solar blaze","count":3}, + {"name":"brightflame","count":1}, + {"name":"eiganjo uprising","count":2}, + {"name":"soulquake","count":1}, + {"name":"casualties of war","count":1}, + {"name":"role reversal","count":1}, + {"name":"time wipe","count":1}, + {"name":"beck/call","count":1}, + {"name":"angelfire ignition","count":1}, + {"name":"gruesome slaughter","count":1}, + {"name":"imperial seal","count":1}, + {"name":"call to the void","count":1}, + {"name":"blood money","count":2}, + {"name":"eldritch pact","count":1}, + {"name":"the elderspell","count":2}, + {"name":"scheming symmetry","count":1}, + {"name":"command the dreadhorde","count":1}, + {"name":"finale of eternity","count":1}, + {"name":"necromantic selection","count":1}, + {"name":"visions of dread","count":1}, + {"name":"extinguish all hope","count":1}, + {"name":"ruinous path","count":1}, + {"name":"ghastly conscription","count":1}, + {"name":"sever the bloodline","count":1}, + {"name":"gild","count":1}, + {"name":"soul transfer","count":2}, + {"name":"in garruk's wake","count":1}, + {"name":"nylea's intervention","count":1}, + {"name":"nissa's renewal","count":1}, + {"name":"finale of devastation","count":1}, + {"name":"traverse the outlands","count":1}, + {"name":"adventurous impulse","count":1}, + {"name":"cultivate","count":1}, + {"name":"storm the festival","count":1}, + {"name":"invoke the ancients","count":1}, + {"name":"nissa's renewal","count":1}, + {"name":"predatory rampage","count":1}, + {"name":"rolling earthquake","count":1}, + {"name":"howl of the horde","count":1}, + {"name":"visions of ruin","count":1}, + {"name":"irencrag feat","count":1}, + {"name":"repeating barrage","count":1}, + {"name":"alpha brawl","count":1}, + {"name":"crater's claws","count":1}, + {"name":"mindblaze","count":1}, + {"name":"radiant flames","count":1}, + {"name":"trade secrets","count":1}, + {"name":"fractured sanity","count":1}, + {"name":"notorious throng","count":1}, + {"name":"reshape","count":1}, + {"name":"river's rebuke","count":1}, + {"name":"stolen identity","count":1}, + {"name":"sakashima's will","count":1}, + {"name":"sculpted sunburst","count":1}, + {"name":"council's judgment","count":1}, + {"name":"farewell","count":1}, + {"name":"gideon's battle cry","count":2}, + {"name":"planar outburst","count":2}, + {"name":"single combat","count":1}, + {"name":"ravnica at war","count":1}, + {"name":"fumigate","count":1}, + {"name":"citywide bust","count":1} + ] +} diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..6b83ed4 --- /dev/null +++ b/src/main.rs @@ -0,0 +1,78 @@ +use reqwest::Error; +use serde::{Deserialize, Serialize}; +use std::collections::HashMap; +use std::fs::File; +use std::io::BufReader; +use tokio::time::Duration; + +#[derive(Serialize, Deserialize, Debug)] +struct Card { + name: String, + prices: HashMap>, +} + +#[derive(Debug, Deserialize)] +struct CardFromFile { + name: String, + count: usize, +} + +#[derive(Debug, Deserialize)] +struct CardFile { + cards: Vec, +} + +#[tokio::main] +async fn main() -> Result<(), Error> { + let file = File::open("cards.json").unwrap(); + let reader = BufReader::new(file); + let cards_data: CardFile = serde_json::from_reader(reader).unwrap(); + + let mut total_card_value_usd = 0.0; + + for card_from_file in &cards_data.cards { + println!("Card: {}, Count: {}", card_from_file.name, card_from_file.count); + + let request_url = format!( + "https://api.scryfall.com/cards/named?exact={}", + card_from_file.name + ); + let response = reqwest::get(&request_url).await?; + let card: Card = response.json().await?; + match card.prices.get("usd") { + Some(price) => match price { + Some(price_str) => { + match price_str.parse::() { + Ok(price) => { + total_card_value_usd += price * card_from_file.count as f64; + println!( + "Card Name: {}, Price in USD: {}, Count: {}", + card.name, price_str, card_from_file.count + ); + } + Err(_) => { + println!( + "Card Name: {}, Price in USD is not a valid number: {}, Count: {}", + card.name, price_str, card_from_file.count + ); + } + } + } + None => println!( + "Card Name: {}, No price available in USD, Count: {}", + card.name, card_from_file.count + ), + }, + None => println!( + "Card Name: {}, No price information available, Count: {}", + card.name, card_from_file.count + ), + } + + tokio::time::sleep(Duration::from_millis(100)).await; // Adding a delay of 100ms + } + + println!("Total value of all cards in USD: {}", total_card_value_usd); + + Ok(()) +}