From d19e223479db647356f10e334079d490a71d61b7 Mon Sep 17 00:00:00 2001 From: Reilly Wood Date: Sat, 14 Dec 2024 15:14:02 -0800 Subject: [PATCH] Vendor OpenSSL on Linux only --- Cargo.lock | 2 +- Cargo.toml | 7 +++++-- README.md | 43 ++++++++++++++++++------------------------- 3 files changed, 24 insertions(+), 28 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index db4a645..026c94d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1350,7 +1350,7 @@ dependencies = [ [[package]] name = "rezoning-scraper" -version = "3.0.2" +version = "3.0.3" dependencies = [ "anyhow", "base64", diff --git a/Cargo.toml b/Cargo.toml index 84f85ca..6a9f641 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rezoning-scraper" -version = "3.0.2" +version = "3.0.3" edition = "2021" [dependencies] @@ -8,7 +8,6 @@ anyhow = "1.0.94" base64 = "0.22.1" chrono = "0.4.39" clap = { version = "4.5.23", features = ["derive"] } -openssl = { version = "0.10", features = ["vendored"], optional = true} scraper = "0.22.0" serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" @@ -17,6 +16,10 @@ reqwest = { version = "0.12.9", features = ["blocking", "json"] } indicatif = "0.17.8" colored = "2.1.0" +# Force vendored OpenSSL on Linux to make building for musl easier +[target.'cfg(target_os = "linux")'.dependencies] +openssl = { version = "0.10", features = ["vendored"]} + # build with `cargo build --profile profiling` # to analyze performance with tooling like linux perf [profile.profiling] diff --git a/README.md b/README.md index 3c54e4d..b0f6e41 100644 --- a/README.md +++ b/README.md @@ -10,41 +10,34 @@ Scrapes the City of Vancouver's website for rezoning and development application ## How to use -Download a binary from [the releases page](https://github.com/rgwood/RezoningScraper/releases) (no external dependencies needed) or build it from source (requires the .NET 8 SDK). Then run it: +Download a binary from [the releases page](https://github.com/rgwood/RezoningScraper/releases) or build it from source ([install Rust](https://rustup.rs/) then run `cargo build --release`). Then run it: ``` -❯ .\RezoningScraper.exe --help -RezoningScraper - A tool to detect new+modified postings on Vancouver's shapeyourcity.ca website. - Data is stored in a local SQLite database next to the executable. -Usage: - RezoningScraper [options] +❯ ./rezoning-scraper --help +Usage: rezoning-scraper [OPTIONS] Options: - --slack-webhook-url A Slack Incoming Webhook URL. If specified, RezoningScraper will post info about new+modified rezonings to this - address. - --save-to-db Whether to save the API results to database. [default: True] - --version Show version information - -?, -h, --help Show help and usage information + --slack-webhook-url + A Slack Incoming Webhook URL. If specified, will post info about new+modified rezonings to this address. + --api-cache + Use cached API responses (up to 1 hour old) when available + --skip-update-db + Skip updating the local database (useful for testing) + -h, --help + Print help + -V, --version + Print version ``` + + ## License Public domain. Do whatever you like with this code, no attribution needed. ## To Do -- [ ] GitHub Actions for build+test -- [x] `--dry-run` flag that doesn't update the local DB -- [x] Add retries to the token fetching. It times out fairly often -- [x] Some kind of development cache thingy. The API is slowwwww and that makes iterative development painful -- [ ] Discord integration? -- [ ] Twitter integration -- [ ] Display more project fields? -- [ ] [This is rough](https://github.com/rgwood/RezoningScraper/blob/ca38460e6ffbd177ef842b0362ff3449737bf3a5/RezoningScraper/TokenHelper.cs#L54-L60), there's gotta be a better way to query JSON -- [ ] Consider archiving old versions of projects -- [x] Hook up to Sentry for error reporting -- [ ] Script deployment+setup (just rsync and cron lol) to a remote server -- [x] Strip line breaks from project titles - CoV does that sometimes and it breaks the Slack link format. -- [x] Consider excluding `published -> archived` state transitions from Slack. Lots of noise, not particularly useful + +- [ ] Hook up to Sentry for error reporting +- [ ] Add option to post to Bluesky \ No newline at end of file