From 17283a9d9bc85a2acfb207dd28b9f3cd3e23c75c Mon Sep 17 00:00:00 2001 From: Neshura Date: Mon, 19 Jun 2023 00:26:50 +0200 Subject: [PATCH] Automatic Lemmy Post creation using jnovel rss feeds only on new chapter --- Cargo.lock | 1785 +++++++++++++++++++++++++++++++++++++++++++ Cargo.toml | 17 + jnovel-example.json | 411 ++++++++++ src/config/mod.rs | 178 +++++ src/main.rs | 182 +++++ 5 files changed, 2573 insertions(+) create mode 100644 Cargo.lock create mode 100644 Cargo.toml create mode 100644 jnovel-example.json create mode 100644 src/config/mod.rs create mode 100644 src/main.rs diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..a7b1a62 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,1785 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "actix" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f728064aca1c318585bf4bb04ffcfac9e75e508ab4e8b1bd9ba5dfe04e2cbed5" +dependencies = [ + "actix-rt", + "actix_derive", + "bitflags", + "bytes", + "crossbeam-channel", + "futures-core", + "futures-sink", + "futures-task", + "futures-util", + "log", + "once_cell", + "parking_lot", + "pin-project-lite", + "smallvec", + "tokio", + "tokio-util", +] + +[[package]] +name = "actix-macros" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "465a6172cf69b960917811022d8f29bc0b7fa1398bc4f78b3c466673db1213b6" +dependencies = [ + "quote", + "syn 1.0.109", +] + +[[package]] +name = "actix-rt" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15265b6b8e2347670eb363c47fc8c75208b4a4994b27192f345fcbe707804f3e" +dependencies = [ + "actix-macros", + "futures-core", + "tokio", +] + +[[package]] +name = "actix_derive" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d44b8fee1ced9671ba043476deddef739dd0959bf77030b26b738cc591737a7" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "aho-corasick" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43f6cb1bf222025340178f382c426f13757b2960e89779dfcb319c32542a5a41" +dependencies = [ + "memchr", +] + +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "anyhow" +version = "1.0.71" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8" + +[[package]] +name = "ascendance-of-a-bookworm-bot" +version = "0.1.0" +dependencies = [ + "chrono", + "lemmy_api_common", + "lemmy_db_schema", + "once_cell", + "reqwest", + "serde", + "serde_derive", + "serde_json", + "url", +] + +[[package]] +name = "async-mutex" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "479db852db25d9dbf6204e6cb6253698f175c15726470f78af0d918e99d6156e" +dependencies = [ + "event-listener", +] + +[[package]] +name = "async-trait" +version = "0.1.68" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.18", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "background-jobs" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793a813f9145c5f3a27b8dcd834c0927de68bbd60d53a369e5894f3cc5759020" +dependencies = [ + "background-jobs-actix", + "background-jobs-core", +] + +[[package]] +name = "background-jobs-actix" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47263ad9c5679419347dae655c2fa2cba078b0eaa51ac758d4f0e9690c06910b" +dependencies = [ + "actix-rt", + "anyhow", + "async-mutex", + "async-trait", + "background-jobs-core", + "serde", + "serde_json", + "thiserror", + "tokio", + "tracing", + "tracing-futures", + "uuid", +] + +[[package]] +name = "background-jobs-core" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48e78e842fe2ae461319e3d1843c12e301630e65650332b02032ac70b0dfc66f" +dependencies = [ + "actix-rt", + "anyhow", + "async-trait", + "event-listener", + "serde", + "serde_json", + "thiserror", + "time 0.3.22", + "tracing", + "tracing-futures", + "uuid", +] + +[[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 = "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 = "chrono" +version = "0.4.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec837a71355b28f6556dbd569b37b3f363091c0bd4b2e735674521b4c5fd9bc5" +dependencies = [ + "android-tzdata", + "iana-time-zone", + "js-sys", + "num-traits", + "serde", + "time 0.1.45", + "wasm-bindgen", + "winapi", +] + +[[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 = "crossbeam-channel" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" +dependencies = [ + "cfg-if", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" +dependencies = [ + "cfg-if", +] + +[[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 0.48.0", +] + +[[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 = "event-listener" +version = "2.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" + +[[package]] +name = "fastrand" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" +dependencies = [ + "instant", +] + +[[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" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" + +[[package]] +name = "futures-executor" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" + +[[package]] +name = "futures-macro" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.18", +] + +[[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-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "getrandom" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", +] + +[[package]] +name = "h2" +version = "0.3.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d357c7ae988e7d2182f7d7871d0b963962420b0678b0997ce7de72001aeab782" +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 = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "hermit-abi" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" +dependencies = [ + "libc", +] + +[[package]] +name = "hermit-abi" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" + +[[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.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab302d72a6f11a3b910431ff93aae7e773078c769f0a3ef15fb9ec692ed147d4" +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 = "iana-time-zone" +version = "0.1.57" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fad5b825842d2b38bd206f3e81d6957625fd7f0a361e345c30e01a0ae2dd613" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[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 = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "io-lifetimes" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" +dependencies = [ + "hermit-abi 0.3.1", + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "ipnet" +version = "2.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12b6ee2129af8d4fb011108c73d99a1b83a85977f23b82460c0ae2e25bb4b57f" + +[[package]] +name = "itoa" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" + +[[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 = "lemmy_api_common" +version = "0.17.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "954e8bfd6df5d9fcf90b752101a48e29c1d0e616d8cde0889df6aaf3d96adbe5" +dependencies = [ + "actix", + "anyhow", + "background-jobs", + "futures", + "lemmy_db_schema", + "lemmy_db_views", + "lemmy_db_views_actor", + "lemmy_db_views_moderator", + "rand", + "regex", + "serde", + "serde_json", + "strum", + "strum_macros", + "tokio", + "url", + "uuid", +] + +[[package]] +name = "lemmy_db_schema" +version = "0.17.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df0fa93e8bf2ad120ed455d4d17423b36631092f1c476362dbf140d5476a8191" +dependencies = [ + "async-trait", + "chrono", + "futures", + "serde", + "strum", + "strum_macros", + "tokio", + "tracing", + "tracing-error", + "typed-builder", + "url", +] + +[[package]] +name = "lemmy_db_views" +version = "0.17.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc54e7eff2534d172e92bef740d22ea4c22b37d59aa028494774b585a65ad785" +dependencies = [ + "lemmy_db_schema", + "serde", + "typed-builder", + "url", +] + +[[package]] +name = "lemmy_db_views_actor" +version = "0.17.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8b30dbb2464b4eab26cbe0732a8c4657d6111bfe0d08eb83cea5884a339df60" +dependencies = [ + "lemmy_db_schema", + "serde", + "typed-builder", +] + +[[package]] +name = "lemmy_db_views_moderator" +version = "0.17.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2b8038a119a65a33ee4773e1197671d37bce0c2a95b32a653b985f0f0dd50c0" +dependencies = [ + "lemmy_db_schema", + "serde", +] + +[[package]] +name = "libc" +version = "0.2.146" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f92be4933c13fd498862a9e02a3055f8a8d9c039ce33db97306fd5a6caa7f29b" + +[[package]] +name = "linux-raw-sys" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" + +[[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 = "mio" +version = "0.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" +dependencies = [ + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys 0.48.0", +] + +[[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-traits" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_cpus" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" +dependencies = [ + "hermit-abi 0.2.6", + "libc", +] + +[[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.54" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69b3f656a17a6cbc115b5c7a40c616947d213ba182135b014d6051b73ab6f019" +dependencies = [ + "bitflags", + "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.18", +] + +[[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.88" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2ce0f250f34a308dcfdbb351f511359857d4ed2134ba715a4eadd46e1ffd617" +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" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c95a7476719eab1e366eaf73d0260af3021184f18177925b07f54b30089ceead" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39407670928234ebc5e6e580247dd567ad73a3578460c5990f9503df207e8f07" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.18", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" + +[[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 = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "proc-macro2" +version = "1.0.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dec2b086b7a862cf4de201096214fa870344cf922b2b30c167badb3af3195406" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b9ab9c7eadfd8df19006f1cf1a4aed13540ed5cbc047010ece5826e10825488" +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.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +dependencies = [ + "bitflags", +] + +[[package]] +name = "regex" +version = "1.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0ab3ca65655bb1e41f2a8c8cd662eb4fb035e67c3f78da1d61dffe89d07300f" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "436b050e76ed2903236f032a59761c1eb99e1b0aead2c257922771dab1fc8c78" + +[[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 = "rustix" +version = "0.37.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b96e891d04aa506a6d1f318d2771bcb1c7dfda84e126660ace067c9b474bb2c0" +dependencies = [ + "bitflags", + "errno", + "io-lifetimes", + "libc", + "linux-raw-sys", + "windows-sys 0.48.0", +] + +[[package]] +name = "rustversion" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f3208ce4d8448b3f3e7d168a73f5e0c43a61e32930de3bceeccedb388b6bf06" + +[[package]] +name = "ryu" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" + +[[package]] +name = "schannel" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "713cfb06c7059f3588fb8044c0fad1d09e3c01d225e25b9220dbfdcf16dbb1b3" +dependencies = [ + "windows-sys 0.42.0", +] + +[[package]] +name = "scopeguard" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" + +[[package]] +name = "security-framework" +version = "2.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fc758eb7bffce5b308734e9b0c1468893cae9ff70ebf13e7090be8dcbcc83a8" +dependencies = [ + "bitflags", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f51d0c0d83bec45f16480d0ce0058397a69e48fcdc52d1dc8855fb68acbd31a7" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "serde" +version = "1.0.164" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e8c8cf938e98f769bc164923b06dce91cea1751522f46f8466461af04c9027d" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.164" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9735b638ccc51c28bf6914d90a2e9725b377144fc612c49a611fddd1b631d68" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.18", +] + +[[package]] +name = "serde_json" +version = "1.0.97" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdf3bf93142acad5821c99197022e170842cdbc1c30482b98750c688c640842a" +dependencies = [ + "indexmap", + "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 = "sharded-slab" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" +dependencies = [ + "lazy_static", +] + +[[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.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" + +[[package]] +name = "socket2" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "strum" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" + +[[package]] +name = "strum_macros" +version = "0.24.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "rustversion", + "syn 1.0.109", +] + +[[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.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32d41677bcbe24c20c52e7c70b0d8db04134c5d1066bf98662e2871ad200ea3e" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "tempfile" +version = "3.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31c0432476357e58790aaa47a8efb0c5138f137343f3b5f23bd36a27e3b0a6d6" +dependencies = [ + "autocfg", + "cfg-if", + "fastrand", + "redox_syscall", + "rustix", + "windows-sys 0.48.0", +] + +[[package]] +name = "thiserror" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.18", +] + +[[package]] +name = "thread_local" +version = "1.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" +dependencies = [ + "cfg-if", + "once_cell", +] + +[[package]] +name = "time" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" +dependencies = [ + "libc", + "wasi 0.10.0+wasi-snapshot-preview1", + "winapi", +] + +[[package]] +name = "time" +version = "0.3.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea9e1b3cf1243ae005d9e74085d4d542f3125458f3a81af210d901dcd7411efd" +dependencies = [ + "itoa", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" + +[[package]] +name = "time-macros" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "372950940a5f07bf38dbe211d7283c9e6d7327df53794992d293e534c733d09b" +dependencies = [ + "time-core", +] + +[[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.28.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94d7b1cfd2aa4011f2de74c2c4c63665e27a71006b0a192dcd2710272e73dfa2" +dependencies = [ + "autocfg", + "bytes", + "libc", + "mio", + "num_cpus", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "windows-sys 0.48.0", +] + +[[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 2.0.18", +] + +[[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-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f57e3ca2a01450b1a921183a9c9cbfda207fd822cef4ccb00a65402cbba7a74" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.18", +] + +[[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 = "tracing-error" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d686ec1c0f384b1277f097b2f279a2ecc11afe8c133c1aabf036a27cb4cd206e" +dependencies = [ + "tracing", + "tracing-subscriber", +] + +[[package]] +name = "tracing-futures" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" +dependencies = [ + "pin-project", + "tracing", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30a651bc37f915e81f087d86e62a18eec5f79550c7faff886f7090b4ea757c77" +dependencies = [ + "sharded-slab", + "thread_local", + "tracing-core", +] + +[[package]] +name = "try-lock" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" + +[[package]] +name = "typed-builder" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89851716b67b937e393b3daa8423e67ddfc4bbbf1654bcf05488e95e0828db0c" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[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.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15811caf2415fb889178633e7724bad2509101cde276048e013b9def5e51fa0" + +[[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", + "serde", +] + +[[package]] +name = "uuid" +version = "1.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fa2982af2eec27de306107c027578ff7f423d65f7250e40ce0fea8f45248b81" +dependencies = [ + "getrandom", + "serde", +] + +[[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.10.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" + +[[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 2.0.18", + "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 2.0.18", + "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" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-sys" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + +[[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.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" +dependencies = [ + "windows_aarch64_gnullvm 0.48.0", + "windows_aarch64_msvc 0.48.0", + "windows_i686_gnu 0.48.0", + "windows_i686_msvc 0.48.0", + "windows_x86_64_gnu 0.48.0", + "windows_x86_64_gnullvm 0.48.0", + "windows_x86_64_msvc 0.48.0", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + +[[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.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" + +[[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.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + +[[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.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" + +[[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.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + +[[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.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + +[[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.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + +[[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..a6c106b --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "ascendance-of-a-bookworm-bot" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +chrono = "0.4.26" +lemmy_api_common = "0.17.4" +lemmy_db_schema = "0.17.4" +once_cell = "1.18.0" +reqwest = { version = "0.11.18", features = ["blocking", "json"] } +serde = "1.0.164" +serde_derive = "1.0.164" +serde_json = "1.0.97" +url = "2.4.0" diff --git a/jnovel-example.json b/jnovel-example.json new file mode 100644 index 0000000..f2ae77c --- /dev/null +++ b/jnovel-example.json @@ -0,0 +1,411 @@ +{ + "version": "https://jsonfeed.org/version/1", + "title": "Ascendance of a Bookworm", + "home_page_url": "https://j-novel.club/series/ascendance-of-a-bookworm", + "description": "A young woman who loves books dies and is reborn in another world as Myne, a sickly child from a poor family. Worst of all, there are almost no books in this world! So Myne decides that she'll just have to make her own and become a librarian.", + "author": { + "name": "J-Novel Club" + }, + "items": [ + { + "id": "https://j-novel.club/read/ascendance-of-a-bookworm-part-5-volume-5-part-6", + "url": "https://j-novel.club/read/ascendance-of-a-bookworm-part-5-volume-5-part-6", + "title": "Ascendance of a Bookworm: Part 5 Volume 5 Part 6", + "summary": "Read Ascendance of a Bookworm: Part 5 Volume 5 Part 6 (available for subscribers)", + "image": "https://d2dq7ifhe7bu0f.cloudfront.net/Part-64872b31036804ff1be232c8/bookworm5.5-cover-400.jpg", + "date_published": "2023-06-12T21:00:00Z" + }, + { + "id": "https://j-novel.club/read/ascendance-of-a-bookworm-part-5-volume-5-part-5", + "url": "https://j-novel.club/read/ascendance-of-a-bookworm-part-5-volume-5-part-5", + "title": "Ascendance of a Bookworm: Part 5 Volume 5 Part 5", + "summary": "Read Ascendance of a Bookworm: Part 5 Volume 5 Part 5 (available for subscribers)", + "image": "https://d2dq7ifhe7bu0f.cloudfront.net/Part-647df642f839a63a784c8b24/bookworm5.5-cover-400.jpg", + "date_published": "2023-06-05T21:00:00Z" + }, + { + "id": "https://j-novel.club/read/ascendance-of-a-bookworm-part-5-volume-5-part-4", + "url": "https://j-novel.club/read/ascendance-of-a-bookworm-part-5-volume-5-part-4", + "title": "Ascendance of a Bookworm: Part 5 Volume 5 Part 4", + "summary": "Read Ascendance of a Bookworm: Part 5 Volume 5 Part 4 (available for subscribers)", + "image": "https://d2dq7ifhe7bu0f.cloudfront.net/Part-6474c52538f2134856b56bbe/bookworm5.5-cover-400.jpg", + "date_published": "2023-05-29T21:00:00Z" + }, + { + "id": "https://j-novel.club/read/ascendance-of-a-bookworm-part-5-volume-5-part-3", + "url": "https://j-novel.club/read/ascendance-of-a-bookworm-part-5-volume-5-part-3", + "title": "Ascendance of a Bookworm: Part 5 Volume 5 Part 3", + "summary": "Read Ascendance of a Bookworm: Part 5 Volume 5 Part 3 (available for subscribers)", + "image": "https://d2dq7ifhe7bu0f.cloudfront.net/Part-646b844e036804ff1be23118/bookworm5.5-cover-400.jpg", + "date_published": "2023-05-22T21:00:00Z" + }, + { + "id": "https://j-novel.club/read/ascendance-of-a-bookworm-part-5-volume-5-part-2", + "url": "https://j-novel.club/read/ascendance-of-a-bookworm-part-5-volume-5-part-2", + "title": "Ascendance of a Bookworm: Part 5 Volume 5 Part 2", + "summary": "Read Ascendance of a Bookworm: Part 5 Volume 5 Part 2 (available for subscribers)", + "image": "https://d2dq7ifhe7bu0f.cloudfront.net/Part-64624ef7a2ea846d6b3f5307/bookworm5.5-cover-400.jpg", + "date_published": "2023-05-15T21:00:00Z" + }, + { + "id": "https://j-novel.club/read/ascendance-of-a-bookworm-part-5-volume-5-part-1", + "url": "https://j-novel.club/read/ascendance-of-a-bookworm-part-5-volume-5-part-1", + "title": "Ascendance of a Bookworm: Part 5 Volume 5 Part 1", + "summary": "Read Ascendance of a Bookworm: Part 5 Volume 5 Part 1 (free)", + "image": "https://d2dq7ifhe7bu0f.cloudfront.net/Part-64594c97cabacabb2c498bfb/bookworm5.5-cover-400.jpg", + "date_published": "2023-05-08T21:00:00Z" + }, + { + "id": "https://j-novel.club/read/ascendance-of-a-bookworm-part-5-volume-4-part-8", + "url": "https://j-novel.club/read/ascendance-of-a-bookworm-part-5-volume-4-part-8", + "title": "Ascendance of a Bookworm: Part 5 Volume 4 Part 8", + "summary": "Read Ascendance of a Bookworm: Part 5 Volume 4 Part 8 (expired)", + "image": "https://d2dq7ifhe7bu0f.cloudfront.net/Part-64400ee2bbfa9b9015a3b4c2/bookworm5.4-cover-400.jpg", + "date_published": "2023-05-01T21:00:00Z" + }, + { + "id": "https://j-novel.club/read/ascendance-of-a-bookworm-part-5-volume-4-part-7", + "url": "https://j-novel.club/read/ascendance-of-a-bookworm-part-5-volume-4-part-7", + "title": "Ascendance of a Bookworm: Part 5 Volume 4 Part 7", + "summary": "Read Ascendance of a Bookworm: Part 5 Volume 4 Part 7 (expired)", + "image": "https://d2dq7ifhe7bu0f.cloudfront.net/Part-64400e5f6f9feb2622ff757a/bookworm5.4-cover-400.jpg", + "date_published": "2023-04-24T21:00:00Z" + }, + { + "id": "https://j-novel.club/read/ascendance-of-a-bookworm-part-5-volume-4-part-6", + "url": "https://j-novel.club/read/ascendance-of-a-bookworm-part-5-volume-4-part-6", + "title": "Ascendance of a Bookworm: Part 5 Volume 4 Part 6", + "summary": "Read Ascendance of a Bookworm: Part 5 Volume 4 Part 6 (expired)", + "image": "https://d2dq7ifhe7bu0f.cloudfront.net/Part-643d5c02bbfa9b9015a3b46a/bookworm5.4-cover-400.jpg", + "date_published": "2023-04-17T21:00:00Z" + }, + { + "id": "https://j-novel.club/read/ascendance-of-a-bookworm-part-5-volume-4-part-5", + "url": "https://j-novel.club/read/ascendance-of-a-bookworm-part-5-volume-4-part-5", + "title": "Ascendance of a Bookworm: Part 5 Volume 4 Part 5", + "summary": "Read Ascendance of a Bookworm: Part 5 Volume 4 Part 5 (expired)", + "image": "https://d2dq7ifhe7bu0f.cloudfront.net/Part-64342367f2df38506778bf87/bookworm5.4-cover-400.jpg", + "date_published": "2023-04-10T21:00:00Z" + }, + { + "id": "https://j-novel.club/read/ascendance-of-a-bookworm-part-5-volume-4-part-4", + "url": "https://j-novel.club/read/ascendance-of-a-bookworm-part-5-volume-4-part-4", + "title": "Ascendance of a Bookworm: Part 5 Volume 4 Part 4", + "summary": "Read Ascendance of a Bookworm: Part 5 Volume 4 Part 4 (expired)", + "image": "https://d2dq7ifhe7bu0f.cloudfront.net/Part-642b04fc89f12f4d2bf611ac/bookworm5.4-cover-400.jpg", + "date_published": "2023-04-03T21:00:00Z" + }, + { + "id": "https://j-novel.club/read/ascendance-of-a-bookworm-part-5-volume-4-part-3", + "url": "https://j-novel.club/read/ascendance-of-a-bookworm-part-5-volume-4-part-3", + "title": "Ascendance of a Bookworm: Part 5 Volume 4 Part 3", + "summary": "Read Ascendance of a Bookworm: Part 5 Volume 4 Part 3 (expired)", + "image": "https://d2dq7ifhe7bu0f.cloudfront.net/Part-6421b4627686c3cd55fc00aa/bookworm5.4-cover-400.jpg", + "date_published": "2023-03-27T21:00:00Z" + }, + { + "id": "https://j-novel.club/read/ascendance-of-a-bookworm-part-5-volume-4-part-2", + "url": "https://j-novel.club/read/ascendance-of-a-bookworm-part-5-volume-4-part-2", + "title": "Ascendance of a Bookworm: Part 5 Volume 4 Part 2", + "summary": "Read Ascendance of a Bookworm: Part 5 Volume 4 Part 2 (expired)", + "image": "https://d2dq7ifhe7bu0f.cloudfront.net/Part-64188110e9be8e3e55d5c6a5/bookworm5.4-cover-400.jpg", + "date_published": "2023-03-20T21:00:00Z" + }, + { + "id": "https://j-novel.club/read/ascendance-of-a-bookworm-part-5-volume-4-part-1", + "url": "https://j-novel.club/read/ascendance-of-a-bookworm-part-5-volume-4-part-1", + "title": "Ascendance of a Bookworm: Part 5 Volume 4 Part 1", + "summary": "Read Ascendance of a Bookworm: Part 5 Volume 4 Part 1 (free)", + "image": "https://d2dq7ifhe7bu0f.cloudfront.net/Part-640f67a67877a2862d88758b/bookworm5.4-cover-400.jpg", + "date_published": "2023-03-13T21:00:00Z" + }, + { + "id": "https://j-novel.club/read/ascendance-of-a-bookworm-part-5-volume-3-part-10", + "url": "https://j-novel.club/read/ascendance-of-a-bookworm-part-5-volume-3-part-10", + "title": "Ascendance of a Bookworm: Part 5 Volume 3 Part 10", + "summary": "Read Ascendance of a Bookworm: Part 5 Volume 3 Part 10 (expired)", + "image": "https://d2dq7ifhe7bu0f.cloudfront.net/Part-63f5f58e785e215d51f3969e/bookworm5.3-cover-400.jpg", + "date_published": "2023-03-06T22:00:00Z" + }, + { + "id": "https://j-novel.club/read/ascendance-of-a-bookworm-part-5-volume-3-part-9", + "url": "https://j-novel.club/read/ascendance-of-a-bookworm-part-5-volume-3-part-9", + "title": "Ascendance of a Bookworm: Part 5 Volume 3 Part 9", + "summary": "Read Ascendance of a Bookworm: Part 5 Volume 3 Part 9 (expired)", + "image": "https://d2dq7ifhe7bu0f.cloudfront.net/Part-63f5f49fd69a89450c0cf2d4/bookworm5.3-cover-400.jpg", + "date_published": "2023-02-27T22:00:00Z" + }, + { + "id": "https://j-novel.club/read/ascendance-of-a-bookworm-part-5-volume-3-part-8", + "url": "https://j-novel.club/read/ascendance-of-a-bookworm-part-5-volume-3-part-8", + "title": "Ascendance of a Bookworm: Part 5 Volume 3 Part 8", + "summary": "Read Ascendance of a Bookworm: Part 5 Volume 3 Part 8 (expired)", + "image": "https://d2dq7ifhe7bu0f.cloudfront.net/Part-63f3efb20179968f16229033/bookworm5.3-cover-400.jpg", + "date_published": "2023-02-20T22:00:00Z" + }, + { + "id": "https://j-novel.club/read/ascendance-of-a-bookworm-part-5-volume-3-part-7", + "url": "https://j-novel.club/read/ascendance-of-a-bookworm-part-5-volume-3-part-7", + "title": "Ascendance of a Bookworm: Part 5 Volume 3 Part 7", + "summary": "Read Ascendance of a Bookworm: Part 5 Volume 3 Part 7 (expired)", + "image": "https://d2dq7ifhe7bu0f.cloudfront.net/Part-63ea88e2d67ef0a916a929ca/bookworm5.3-cover-400.jpg", + "date_published": "2023-02-13T22:00:00Z" + }, + { + "id": "https://j-novel.club/read/ascendance-of-a-bookworm-part-5-volume-3-part-6", + "url": "https://j-novel.club/read/ascendance-of-a-bookworm-part-5-volume-3-part-6", + "title": "Ascendance of a Bookworm: Part 5 Volume 3 Part 6", + "summary": "Read Ascendance of a Bookworm: Part 5 Volume 3 Part 6 (expired)", + "image": "https://d2dq7ifhe7bu0f.cloudfront.net/Part-63e14f6c2f6ef88b59e0cc3d/bookworm5.3-cover-400.jpg", + "date_published": "2023-02-06T22:00:00Z" + }, + { + "id": "https://j-novel.club/read/ascendance-of-a-bookworm-part-5-volume-3-part-5", + "url": "https://j-novel.club/read/ascendance-of-a-bookworm-part-5-volume-3-part-5", + "title": "Ascendance of a Bookworm: Part 5 Volume 3 Part 5", + "summary": "Read Ascendance of a Bookworm: Part 5 Volume 3 Part 5 (expired)", + "image": "https://d2dq7ifhe7bu0f.cloudfront.net/Part-63d817bc552bedd02ef0f2d2/bookworm5.3-cover-400.jpg", + "date_published": "2023-01-30T22:00:00Z" + }, + { + "id": "https://j-novel.club/read/ascendance-of-a-bookworm-part-5-volume-3-part-4", + "url": "https://j-novel.club/read/ascendance-of-a-bookworm-part-5-volume-3-part-4", + "title": "Ascendance of a Bookworm: Part 5 Volume 3 Part 4", + "summary": "Read Ascendance of a Bookworm: Part 5 Volume 3 Part 4 (expired)", + "image": "https://d2dq7ifhe7bu0f.cloudfront.net/Part-63cef187c1f813e8051c11f6/bookworm5.3-cover-400.jpg", + "date_published": "2023-01-23T22:00:00Z" + }, + { + "id": "https://j-novel.club/read/ascendance-of-a-bookworm-part-5-volume-3-part-3", + "url": "https://j-novel.club/read/ascendance-of-a-bookworm-part-5-volume-3-part-3", + "title": "Ascendance of a Bookworm: Part 5 Volume 3 Part 3", + "summary": "Read Ascendance of a Bookworm: Part 5 Volume 3 Part 3 (expired)", + "image": "https://d2dq7ifhe7bu0f.cloudfront.net/Part-63c5c96cfcd981160ed7f4b9/bookworm5.3-cover-400.jpg", + "date_published": "2023-01-16T22:00:00Z" + }, + { + "id": "https://j-novel.club/read/ascendance-of-a-bookworm-part-5-volume-3-part-2", + "url": "https://j-novel.club/read/ascendance-of-a-bookworm-part-5-volume-3-part-2", + "title": "Ascendance of a Bookworm: Part 5 Volume 3 Part 2", + "summary": "Read Ascendance of a Bookworm: Part 5 Volume 3 Part 2 (expired)", + "image": "https://d2dq7ifhe7bu0f.cloudfront.net/Part-63bc72e9482b67ed0f4e130f/bookworm5.3-cover-400.jpg", + "date_published": "2023-01-09T22:00:00Z" + }, + { + "id": "https://j-novel.club/read/ascendance-of-a-bookworm-part-5-volume-3-part-1", + "url": "https://j-novel.club/read/ascendance-of-a-bookworm-part-5-volume-3-part-1", + "title": "Ascendance of a Bookworm: Part 5 Volume 3 Part 1", + "summary": "Read Ascendance of a Bookworm: Part 5 Volume 3 Part 1 (free)", + "image": "https://d2dq7ifhe7bu0f.cloudfront.net/Part-63af316e41fdb4b16fa9f3b5/bookworm5.3-cover-400.jpg", + "date_published": "2023-01-02T22:00:00Z" + }, + { + "id": "https://j-novel.club/read/ascendance-of-a-bookworm-part-5-volume-2-part-8", + "url": "https://j-novel.club/read/ascendance-of-a-bookworm-part-5-volume-2-part-8", + "title": "Ascendance of a Bookworm: Part 5 Volume 2 Part 8", + "summary": "Read Ascendance of a Bookworm: Part 5 Volume 2 Part 8 (expired)", + "image": "https://d2dq7ifhe7bu0f.cloudfront.net/Part-63971a23811dc9950fe219ad/bookworm5.2-cover-400.jpg", + "date_published": "2022-12-26T22:00:00Z" + }, + { + "id": "https://j-novel.club/read/ascendance-of-a-bookworm-part-5-volume-2-part-7", + "url": "https://j-novel.club/read/ascendance-of-a-bookworm-part-5-volume-2-part-7", + "title": "Ascendance of a Bookworm: Part 5 Volume 2 Part 7", + "summary": "Read Ascendance of a Bookworm: Part 5 Volume 2 Part 7 (expired)", + "image": "https://d2dq7ifhe7bu0f.cloudfront.net/Part-639719efa6449c0010fb311e/bookworm5.2-cover-400.jpg", + "date_published": "2022-12-19T22:00:00Z" + }, + { + "id": "https://j-novel.club/read/ascendance-of-a-bookworm-part-5-volume-2-part-6", + "url": "https://j-novel.club/read/ascendance-of-a-bookworm-part-5-volume-2-part-6", + "title": "Ascendance of a Bookworm: Part 5 Volume 2 Part 6", + "summary": "Read Ascendance of a Bookworm: Part 5 Volume 2 Part 6 (expired)", + "image": "https://d2dq7ifhe7bu0f.cloudfront.net/Part-6397050a75e261ab0f505a6b/bookworm5.2-cover-400.jpg", + "date_published": "2022-12-12T22:00:00Z" + }, + { + "id": "https://j-novel.club/read/ascendance-of-a-bookworm-part-5-volume-2-part-5", + "url": "https://j-novel.club/read/ascendance-of-a-bookworm-part-5-volume-2-part-5", + "title": "Ascendance of a Bookworm: Part 5 Volume 2 Part 5", + "summary": "Read Ascendance of a Bookworm: Part 5 Volume 2 Part 5 (expired)", + "image": "https://d2dq7ifhe7bu0f.cloudfront.net/Part-638e67708fc63f8c3f1a524a/bookworm5.2-cover-400.jpg", + "date_published": "2022-12-05T22:00:00Z" + }, + { + "id": "https://j-novel.club/read/ascendance-of-a-bookworm-part-5-volume-2-part-4", + "url": "https://j-novel.club/read/ascendance-of-a-bookworm-part-5-volume-2-part-4", + "title": "Ascendance of a Bookworm: Part 5 Volume 2 Part 4", + "summary": "Read Ascendance of a Bookworm: Part 5 Volume 2 Part 4 (expired)", + "image": "https://d2dq7ifhe7bu0f.cloudfront.net/Part-6384ed590517e1e171e6c551/bookworm5.2-cover-400.jpg", + "date_published": "2022-11-28T22:00:00Z" + }, + { + "id": "https://j-novel.club/read/ascendance-of-a-bookworm-part-5-volume-2-part-3", + "url": "https://j-novel.club/read/ascendance-of-a-bookworm-part-5-volume-2-part-3", + "title": "Ascendance of a Bookworm: Part 5 Volume 2 Part 3", + "summary": "Read Ascendance of a Bookworm: Part 5 Volume 2 Part 3 (expired)", + "image": "https://d2dq7ifhe7bu0f.cloudfront.net/Part-637b9c13449c28d01bb4b4cd/bookworm5.2-cover-400.jpg", + "date_published": "2022-11-21T22:00:00Z" + }, + { + "id": "https://j-novel.club/read/ascendance-of-a-bookworm-part-5-volume-2-part-2", + "url": "https://j-novel.club/read/ascendance-of-a-bookworm-part-5-volume-2-part-2", + "title": "Ascendance of a Bookworm: Part 5 Volume 2 Part 2", + "summary": "Read Ascendance of a Bookworm: Part 5 Volume 2 Part 2 (expired)", + "image": "https://d2dq7ifhe7bu0f.cloudfront.net/Part-63729a99563cdce739e17427/bookworm5.2-cover-400.jpg", + "date_published": "2022-11-14T22:00:00Z" + }, + { + "id": "https://j-novel.club/read/ascendance-of-a-bookworm-part-5-volume-2-part-1", + "url": "https://j-novel.club/read/ascendance-of-a-bookworm-part-5-volume-2-part-1", + "title": "Ascendance of a Bookworm: Part 5 Volume 2 Part 1", + "summary": "Read Ascendance of a Bookworm: Part 5 Volume 2 Part 1 (free)", + "image": "https://d2dq7ifhe7bu0f.cloudfront.net/Part-636942940f70ce58739b2844/bookworm5.2-cover-400.jpg", + "date_published": "2022-11-07T22:00:00Z" + }, + { + "id": "https://j-novel.club/read/ascendance-of-a-bookworm-part-5-volume-1-part-8", + "url": "https://j-novel.club/read/ascendance-of-a-bookworm-part-5-volume-1-part-8", + "title": "Ascendance of a Bookworm: Part 5 Volume 1 Part 8", + "summary": "Read Ascendance of a Bookworm: Part 5 Volume 1 Part 8 (expired)", + "image": "https://d2dq7ifhe7bu0f.cloudfront.net/Part-634dbbabb2895e4e5862a45e/bookworm5.1-cover-400.jpg", + "date_published": "2022-10-31T21:00:00Z" + }, + { + "id": "https://j-novel.club/read/ascendance-of-a-bookworm-part-5-volume-1-part-7", + "url": "https://j-novel.club/read/ascendance-of-a-bookworm-part-5-volume-1-part-7", + "title": "Ascendance of a Bookworm: Part 5 Volume 1 Part 7", + "summary": "Read Ascendance of a Bookworm: Part 5 Volume 1 Part 7 (expired)", + "image": "https://d2dq7ifhe7bu0f.cloudfront.net/Part-634dbb87a25e943074d2ede9/bookworm5.1-cover-400.jpg", + "date_published": "2022-10-24T21:00:00Z" + }, + { + "id": "https://j-novel.club/read/ascendance-of-a-bookworm-part-5-volume-1-part-6", + "url": "https://j-novel.club/read/ascendance-of-a-bookworm-part-5-volume-1-part-6", + "title": "Ascendance of a Bookworm: Part 5 Volume 1 Part 6", + "summary": "Read Ascendance of a Bookworm: Part 5 Volume 1 Part 6 (expired)", + "image": "https://d2dq7ifhe7bu0f.cloudfront.net/Part-634dbab44f712abf7c52d3a0/bookworm5.1-cover-400.jpg", + "date_published": "2022-10-17T21:00:00Z" + }, + { + "id": "https://j-novel.club/read/ascendance-of-a-bookworm-part-5-volume-1-part-5", + "url": "https://j-novel.club/read/ascendance-of-a-bookworm-part-5-volume-1-part-5", + "title": "Ascendance of a Bookworm: Part 5 Volume 1 Part 5", + "summary": "Read Ascendance of a Bookworm: Part 5 Volume 1 Part 5 (expired)", + "image": "https://d2dq7ifhe7bu0f.cloudfront.net/Part-63443bda3b3c7e893a05596b/bookworm5.1-cover-400.jpg", + "date_published": "2022-10-10T21:00:00Z" + }, + { + "id": "https://j-novel.club/read/ascendance-of-a-bookworm-part-5-volume-1-part-4", + "url": "https://j-novel.club/read/ascendance-of-a-bookworm-part-5-volume-1-part-4", + "title": "Ascendance of a Bookworm: Part 5 Volume 1 Part 4", + "summary": "Read Ascendance of a Bookworm: Part 5 Volume 1 Part 4 (expired)", + "image": "https://d2dq7ifhe7bu0f.cloudfront.net/Part-633b2f6c95d05f661f46b179/bookworm5.1-cover-400.jpg", + "date_published": "2022-10-03T21:00:00Z" + }, + { + "id": "https://j-novel.club/read/ascendance-of-a-bookworm-part-5-volume-1-part-3", + "url": "https://j-novel.club/read/ascendance-of-a-bookworm-part-5-volume-1-part-3", + "title": "Ascendance of a Bookworm: Part 5 Volume 1 Part 3", + "summary": "Read Ascendance of a Bookworm: Part 5 Volume 1 Part 3 (expired)", + "image": "https://d2dq7ifhe7bu0f.cloudfront.net/Part-6331af2e6d287a7b7268489d/bookworm5.1-cover-400.jpg", + "date_published": "2022-09-26T21:00:00Z" + }, + { + "id": "https://j-novel.club/read/ascendance-of-a-bookworm-part-5-volume-1-part-2", + "url": "https://j-novel.club/read/ascendance-of-a-bookworm-part-5-volume-1-part-2", + "title": "Ascendance of a Bookworm: Part 5 Volume 1 Part 2", + "summary": "Read Ascendance of a Bookworm: Part 5 Volume 1 Part 2 (expired)", + "image": "https://d2dq7ifhe7bu0f.cloudfront.net/Part-6328d459853da3577cbdd6f9/bookworm5.1-cover-400.jpg", + "date_published": "2022-09-19T21:00:00Z" + }, + { + "id": "https://j-novel.club/read/ascendance-of-a-bookworm-part-5-volume-1-part-1", + "url": "https://j-novel.club/read/ascendance-of-a-bookworm-part-5-volume-1-part-1", + "title": "Ascendance of a Bookworm: Part 5 Volume 1 Part 1", + "summary": "Read Ascendance of a Bookworm: Part 5 Volume 1 Part 1 (free)", + "image": "https://d2dq7ifhe7bu0f.cloudfront.net/Part-631f9aed59b60299586f0b29/bookworm5.1-cover-400.jpg", + "date_published": "2022-09-12T21:00:00Z" + }, + { + "id": "https://j-novel.club/read/ascendance-of-a-bookworm-part-4-volume-9-part-8", + "url": "https://j-novel.club/read/ascendance-of-a-bookworm-part-4-volume-9-part-8", + "title": "Ascendance of a Bookworm: Part 4 Volume 9 Part 8", + "summary": "Read Ascendance of a Bookworm: Part 4 Volume 9 Part 8 (expired)", + "image": "https://d2dq7ifhe7bu0f.cloudfront.net/Part-6303e4666164ffe71fb3039c/bookworm4.9-cover-400.jpg", + "date_published": "2022-09-05T21:00:00Z" + }, + { + "id": "https://j-novel.club/read/ascendance-of-a-bookworm-part-4-volume-9-part-7", + "url": "https://j-novel.club/read/ascendance-of-a-bookworm-part-4-volume-9-part-7", + "title": "Ascendance of a Bookworm: Part 4 Volume 9 Part 7", + "summary": "Read Ascendance of a Bookworm: Part 4 Volume 9 Part 7 (expired)", + "image": "https://d2dq7ifhe7bu0f.cloudfront.net/Part-6303e45cbfd3ac0620743003/bookworm4.9-cover-400.jpg", + "date_published": "2022-08-29T21:00:00Z" + }, + { + "id": "https://j-novel.club/read/ascendance-of-a-bookworm-part-4-volume-9-part-6", + "url": "https://j-novel.club/read/ascendance-of-a-bookworm-part-4-volume-9-part-6", + "title": "Ascendance of a Bookworm: Part 4 Volume 9 Part 6", + "summary": "Read Ascendance of a Bookworm: Part 4 Volume 9 Part 6 (expired)", + "image": "https://d2dq7ifhe7bu0f.cloudfront.net/Part-6303e3df95d05f661f46ae31/bookworm4.9-cover-400.jpg", + "date_published": "2022-08-22T21:00:00Z" + }, + { + "id": "https://j-novel.club/read/ascendance-of-a-bookworm-part-4-volume-9-part-5", + "url": "https://j-novel.club/read/ascendance-of-a-bookworm-part-4-volume-9-part-5", + "title": "Ascendance of a Bookworm: Part 4 Volume 9 Part 5", + "summary": "Read Ascendance of a Bookworm: Part 4 Volume 9 Part 5 (expired)", + "image": "https://d2dq7ifhe7bu0f.cloudfront.net/Part-62fa9d2e3690f46d54265b03/bookworm4.9-cover-400.jpg", + "date_published": "2022-08-15T21:00:00Z" + }, + { + "id": "https://j-novel.club/read/ascendance-of-a-bookworm-part-4-volume-9-part-4", + "url": "https://j-novel.club/read/ascendance-of-a-bookworm-part-4-volume-9-part-4", + "title": "Ascendance of a Bookworm: Part 4 Volume 9 Part 4", + "summary": "Read Ascendance of a Bookworm: Part 4 Volume 9 Part 4 (expired)", + "image": "https://d2dq7ifhe7bu0f.cloudfront.net/Part-62f16bb8a9f787ca5446a1b8/bookworm4.9-cover-400.jpg", + "date_published": "2022-08-08T21:00:00Z" + }, + { + "id": "https://j-novel.club/read/ascendance-of-a-bookworm-part-4-volume-9-part-3", + "url": "https://j-novel.club/read/ascendance-of-a-bookworm-part-4-volume-9-part-3", + "title": "Ascendance of a Bookworm: Part 4 Volume 9 Part 3", + "summary": "Read Ascendance of a Bookworm: Part 4 Volume 9 Part 3 (expired)", + "image": "https://d2dq7ifhe7bu0f.cloudfront.net/Part-62e792b17d8cd29c54d666b6/bookworm4.9-cover-400.jpg", + "date_published": "2022-08-01T21:00:00Z" + }, + { + "id": "https://j-novel.club/read/ascendance-of-a-bookworm-part-4-volume-9-part-2", + "url": "https://j-novel.club/read/ascendance-of-a-bookworm-part-4-volume-9-part-2", + "title": "Ascendance of a Bookworm: Part 4 Volume 9 Part 2", + "summary": "Read Ascendance of a Bookworm: Part 4 Volume 9 Part 2 (expired)", + "image": "https://d2dq7ifhe7bu0f.cloudfront.net/Part-62def2b5de7f5911540ea23e/bookworm4.9-cover-400.jpg", + "date_published": "2022-07-25T21:00:00Z" + }, + { + "id": "https://j-novel.club/read/ascendance-of-a-bookworm-part-4-volume-9-part-1", + "url": "https://j-novel.club/read/ascendance-of-a-bookworm-part-4-volume-9-part-1", + "title": "Ascendance of a Bookworm: Part 4 Volume 9 Part 1", + "summary": "Read Ascendance of a Bookworm: Part 4 Volume 9 Part 1 (free)", + "image": "https://d2dq7ifhe7bu0f.cloudfront.net/Part-62d599c27d8cd29c54d665d5/bookworm4.9-cover-400.jpg", + "date_published": "2022-07-18T21:00:00Z" + }, + { + "id": "https://j-novel.club/read/ascendance-of-a-bookworm-part-4-volume-8-part-8", + "url": "https://j-novel.club/read/ascendance-of-a-bookworm-part-4-volume-8-part-8", + "title": "Ascendance of a Bookworm: Part 4 Volume 8 Part 8", + "summary": "Read Ascendance of a Bookworm: Part 4 Volume 8 Part 8 (expired)", + "image": "https://d2dq7ifhe7bu0f.cloudfront.net/Part-62bb698fd440cc5d411b50b1/bookworm4.8-cover-400.jpg", + "date_published": "2022-07-11T21:00:00Z" + }, + { + "id": "https://j-novel.club/read/ascendance-of-a-bookworm-part-4-volume-8-part-7", + "url": "https://j-novel.club/read/ascendance-of-a-bookworm-part-4-volume-8-part-7", + "title": "Ascendance of a Bookworm: Part 4 Volume 8 Part 7", + "summary": "Read Ascendance of a Bookworm: Part 4 Volume 8 Part 7 (expired)", + "image": "https://d2dq7ifhe7bu0f.cloudfront.net/Part-62ba0e44cbbd90be7aca1380/bookworm4.8-cover-400.jpg", + "date_published": "2022-07-04T21:00:00Z" + } + ] +} diff --git a/src/config/mod.rs b/src/config/mod.rs new file mode 100644 index 0000000..1399c31 --- /dev/null +++ b/src/config/mod.rs @@ -0,0 +1,178 @@ +use std::{fs::{self, OpenOptions}, path::Path, io::Write}; + +use lemmy_api_common::sensitive::Sensitive; +use serde_derive::{Deserialize, Serialize}; + +macro_rules! pub_struct { + ($name:ident {$($field:ident: $t:ty,)*}) => { + #[derive(Serialize, Deserialize, Clone)] + pub(crate) struct $name { + $(pub(crate) $field: $t), * + } + } +} + +// Secrets structs +pub_struct!(Secrets { + lemmy: LemmyLogin, + reddit: RedditLogin, +}); + +impl Secrets { + pub(crate) fn load() -> Secrets { + let file_contents = match fs::read_to_string("secrets.json") { + Ok(data) => data, + Err(e) => panic!("ERROR: secrets.json could not be read:\n\n{:#?}", e), + }; + let config_parse: Secrets = match serde_json::from_str(&file_contents) { + Ok(data) => data, + Err(e) => panic!("ERROR: secrets.json could not be parsed:\n\n{:#?}", e), + }; + + return config_parse; + } +} + +#[derive(Serialize, Deserialize, Clone)] +pub(crate) struct LemmyLogin { + pub(crate) username: String, + password: String +} + +impl LemmyLogin { + pub(crate) fn get_username(&self) -> Sensitive { + return Sensitive::new(self.username.clone()); + } + + pub(crate) fn get_password(&self) -> Sensitive { + return Sensitive::new(self.password.clone()) + } +} + +#[derive(Serialize, Deserialize, Clone)] +pub(crate) struct RedditLogin { + pub(crate) app_id: String, + app_secret: String, + refresh_token: String, + redirect_uri: String, +} + +// Config structs +pub_struct!(Config { + reddit_config: RedditConfig, + feeds: Vec, +}); + +impl Config { + pub(crate) fn load() -> Config { + let file_contents = match fs::read_to_string("config.json") { + Ok(data) => data, + Err(e) => panic!("ERROR: config.json could not be read:\n\n{:#?}", e), + }; + let config_parse: Config = match serde_json::from_str(&file_contents) { + Ok(data) => data, + Err(e) => panic!("ERROR: config.json could not be parsed:\n\n{:#?}", e), + }; + + return config_parse; + } +} + +pub_struct!(RedditConfig { + user_agent: String, + subreddit: String, +}); + +pub_struct!(FeedSetting { + feed_url: String, + communities: FeedCommunities, + reddit: FeedRedditSettings, +}); + +pub_struct!(FeedCommunities { + chapter: LemmyCommunities, + volume: LemmyCommunities, +}); + +#[derive(Serialize, Deserialize, Clone)] +#[allow(non_camel_case_types)] +pub(crate) enum LemmyCommunities { + aobwebnovel, + aobprepub, + aoblightnovel, + aobmanga, + aobanime +} + +pub_struct!(FeedRedditSettings { + enabled: bool, + flair: String, +}); + +// Posts structs +pub_struct!(PrevPost { + title: String, + last_post_url: String, +}); + +impl PrevPost { + pub(crate) fn load() -> Vec { + let history; + + if Path::new("posts.json").exists() { + let file_contents = match fs::read_to_string("posts.json") { + Ok(data) => data, + Err(e) => panic!("ERROR: secrets.json could not be read:\n\n{:#?}", e), + }; + + if file_contents.len() > 0 { + let history_parse: Vec = match serde_json::from_str(&file_contents) { + Ok(data) => data, + Err(e) => panic!("ERROR: secrets.json could not be parsed:\n\n{:#?}", e), + }; + history = history_parse; + } + else { + history = [].to_vec() + } + } + else { + let _ = fs::File::create("posts.json"); + history = [].to_vec() + } + + return history; + } + + pub(crate) fn save(data: &Vec) { + let mut file = OpenOptions::new().read(true).write(true).create(true).open("posts.json").unwrap(); + + let json_data = serde_json::to_string_pretty(&data).unwrap(); + + write!(&mut file, "{}", json_data).unwrap(); + } +} + +// RSS Feed Structs +pub_struct!(FeedData { + version: String, + title: String, + home_page_url: String, + description: String, + author: FeedAuthor, + items: Vec, +}); + +pub_struct!(FeedAuthor { + name: String, +}); + +pub_struct!(FeedEntry { + id: String, + url: String, + title: String, + summary: String, + image: Option, + date_published: String, +}); + diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..6a21857 --- /dev/null +++ b/src/main.rs @@ -0,0 +1,182 @@ +use chrono::Utc; +use config::{Config, PrevPost, Secrets}; +use lemmy_api_common::{ + person::{Login, LoginResponse}, + post::{CreatePost, GetPosts, GetPostsResponse}, + sensitive::Sensitive, +}; +use lemmy_db_schema::{ + newtypes::{CommunityId, LanguageId}, + ListingType, SortType, +}; +use once_cell::sync::Lazy; +use reqwest::{blocking::Client, StatusCode}; +use std::{thread::sleep, time}; +use url::Url; + +use crate::config::FeedData; +mod config; + +pub static CLIENT: Lazy = Lazy::new(|| { + let client = Client::builder() + .timeout(time::Duration::from_secs(30)) + .connect_timeout(time::Duration::from_secs(30)) + .build() + .expect("build client"); + client +}); + +struct Bot { + secrets: Secrets, + config: Config, + post_history: Vec, + auth: Sensitive, +} + +impl Bot { + pub(crate) fn new() -> Bot { + Bot { + secrets: Secrets::load(), + config: Config::load(), + post_history: PrevPost::load(), + auth: Sensitive::new("".to_string()), + } + } + + pub(crate) fn login(&mut self) { + let login_params = Login { + username_or_email: self.secrets.lemmy.get_username(), + password: self.secrets.lemmy.get_password(), + }; + + let res = CLIENT + .post("https://lemmy.neshweb.net/api/v3/user/login") + .json(&login_params) + .send() + .unwrap(); + + if res.status() == StatusCode::OK { + let data: &LoginResponse = &res.json().unwrap(); + + let jwt = data.jwt.clone().expect("JWT Token could not be acquired"); + self.auth = jwt; + } else { + println!("Error Code: {:?}", res.status()); + panic!("JWT Token could not be acquired"); + } + } + + pub(crate) fn post(&mut self, post_data: CreatePost) { + let res = CLIENT + .post("https://lemmy.neshweb.net/api/v3/post") + .json(&post_data) + .send() + .unwrap(); + } +} + +fn list_posts(auth: &Sensitive) -> GetPostsResponse { + let params = GetPosts { + type_: Some(ListingType::Local), + sort: Some(SortType::New), + auth: Some(auth.clone()), + ..Default::default() + }; + + let res = CLIENT + .get("https://lemmy.neshweb.net/api/v3/post/list") + .query(¶ms) + .send() + .unwrap() + .text() + .unwrap(); + + return serde_json::from_str(&res).unwrap(); +} + +fn main() { + // Get all needed auth tokens at the start + let mut old = Utc::now().time(); + let mut this = Bot::new(); + println!("{}", this.secrets.lemmy.username); + this.login(); + + // Create empty eTag list + println!("TODO: Etag list"); + + // Enter a loop (not for debugging) + loop { + let start = Utc::now(); + print!("\x1B[2J\x1B[1;1H"); + println!("Started loop at {} {}", start.format("%H:%M:%S"), start.timezone()); + + if start.time() - old > chrono::Duration::seconds(6) { + old = start.time(); + this.config = Config::load(); + } + + // Start the polling process + // Get all feed URLs (use cache) + let mut post_queue: Vec = vec![]; + this.config.feeds.iter().for_each(|feed| { + let res = CLIENT + .get(feed.feed_url.clone()) + .send() + .unwrap() + .text() + .unwrap(); + let data: FeedData = serde_json::from_str(&res).unwrap(); + + let mut prev_post_idx: Option = None; + let mut do_post = true; + this.post_history + .iter() + .enumerate() + .for_each(|(idx, post)| { + if &post.last_post_url == &data.items[0].url { + do_post = false; + } else if &post.title == &data.title { + prev_post_idx = Some(idx); + } + }); + + if do_post { + let item = &data.items[0]; + let new_post = CreatePost { + name: item.title.clone(), + community_id: CommunityId(3), // TODO get community id by using community name at the start, save it in a list, planned refresh once a day + url: Some(Url::parse(&item.url).unwrap()), + body: Some( + "[Reddit](https://reddit.com)\n\n[Discord](https://discord.com)".into(), + ), + honeypot: None, + nsfw: Some(false), + language_id: Some(LanguageId(0)), // TODO get English language id by api (at the start) + auth: this.auth.clone(), + }; + post_queue.push(new_post); + match prev_post_idx { + Some(idx) => { + this.post_history[idx].title = data.title; + this.post_history[idx].last_post_url = item.url.clone(); + } + None => this.post_history.push(PrevPost { + title: data.title, + last_post_url: item.url.clone(), + }), + } + } + sleep(time::Duration::from_millis(100)); // Should prevent dos-ing J-Novel servers + }); + + PrevPost::save(&this.post_history); + post_queue.iter().for_each(|post| { + println!("Posted: {}", post.name); + this.post(post.clone()); + }); + + while Utc::now().time() - start.time() < chrono::Duration::seconds(60) { + sleep(time::Duration::from_secs(10)); + } + } +}