Skip to content

Commit 59f016c

Browse files
committed
chore(website): add dynamic link find
1 parent da970e3 commit 59f016c

File tree

8 files changed

+129
-74
lines changed

8 files changed

+129
-74
lines changed

Cargo.lock

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

default.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
let
44
spider = pkgs.rustPlatform.buildRustPackage {
55
pname = "spider";
6-
version = "2.37.193";
6+
version = "2.38.1";
77

88
src = ./.;
99

examples/callback.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@ use spider::website::Website;
77
#[tokio::main]
88
async fn main() {
99
let mut website: Website = Website::new("https://rsseau.fr/en");
10-
website.on_link_find_callback = Some(|s, ss| {
11-
println!("link target: {:?}", s);
10+
11+
let some = "custom";
12+
13+
website.set_on_link_find(move |s, ss| {
14+
println!("link target: {:?} - {some}", s);
1215
// forward link to a different destination
1316
(s.as_ref().replacen("/fr/", "", 1).into(), ss)
1417
});

spider/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "spider"
3-
version = "2.37.193"
3+
version = "2.38.1"
44
authors = ["j-mendez <[email protected]>"]
55
description = "A web crawler and scraper, building blocks for data curation workloads."
66
repository = "https://github.com/spider-rs/spider"

0 commit comments

Comments
 (0)