-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
82 additions
and
21 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "spider_examples" | ||
version = "1.41.0" | ||
version = "1.41.1" | ||
authors = ["madeindjs <[email protected]>", "j-mendez <[email protected]>"] | ||
description = "Multithreaded web crawler written in Rust." | ||
repository = "https://github.com/spider-rs/spider" | ||
|
@@ -22,7 +22,7 @@ htr = "0.5.27" | |
flexbuffers = "2.0.0" | ||
|
||
[dependencies.spider] | ||
version = "1.41.0" | ||
version = "1.41.1" | ||
path = "../spider" | ||
features = ["serde"] | ||
|
||
|
@@ -57,3 +57,8 @@ path = "subscribe.rs" | |
[[example]] | ||
name = "callback" | ||
path = "callback.rs" | ||
|
||
[[example]] | ||
name = "sitemap" | ||
path = "sitemap.rs" | ||
features = ["sitemap"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
//! `cargo run --example sitemap` | ||
extern crate spider; | ||
|
||
use spider::tokio; | ||
use spider::website::Website; | ||
use std::time::Instant; | ||
|
||
#[tokio::main] | ||
async fn main() { | ||
let mut website: Website = Website::new("https://rsseau.fr"); | ||
website | ||
.configuration | ||
.blacklist_url | ||
.insert(Default::default()) | ||
.push("https://rsseau.fr/resume".into()); | ||
website.configuration.respect_robots_txt = true; | ||
website.configuration.subdomains = false; | ||
website.configuration.delay = 0; // Defaults to 0 ms | ||
website.configuration.user_agent = Some(Box::new("SpiderBot".into())); // Defaults to spider/x.y.z, where x.y.z is the library version | ||
|
||
let start = Instant::now(); | ||
website.crawl().await; | ||
let duration = start.elapsed(); | ||
|
||
let links = website.get_links(); | ||
|
||
for link in links { | ||
println!("- {:?}", link.as_ref()); | ||
} | ||
|
||
println!( | ||
"Time elapsed in website.crawl() is: {:?} for total pages: {:?}", | ||
duration, | ||
links.len() | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "spider" | ||
version = "1.41.0" | ||
version = "1.41.1" | ||
authors = ["madeindjs <[email protected]>", "j-mendez <[email protected]>"] | ||
description = "The fastest web crawler written in Rust." | ||
repository = "https://github.com/spider-rs/spider" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "spider_cli" | ||
version = "1.41.0" | ||
version = "1.41.1" | ||
authors = ["madeindjs <[email protected]>", "j-mendez <[email protected]>"] | ||
description = "The fastest web crawler CLI written in Rust." | ||
repository = "https://github.com/spider-rs/spider" | ||
|
@@ -26,7 +26,7 @@ quote = "1.0.18" | |
failure_derive = "0.1.8" | ||
|
||
[dependencies.spider] | ||
version = "1.41.0" | ||
version = "1.41.1" | ||
path = "../spider" | ||
|
||
[[bin]] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,7 +40,7 @@ spider --domain http://localhost:3000 download -t _temp_spider_downloads | |
``` | ||
|
||
```sh | ||
spider_cli 1.41.0 | ||
spider_cli 1.41.1 | ||
madeindjs <[email protected]>, j-mendez <[email protected]> | ||
The fastest web crawler CLI written in Rust. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "spider_worker" | ||
version = "1.41.0" | ||
version = "1.41.1" | ||
authors = ["madeindjs <[email protected]>", "j-mendez <[email protected]>"] | ||
description = "The fastest web crawler CLI written in Rust." | ||
repository = "https://github.com/spider-rs/spider" | ||
|
@@ -22,7 +22,7 @@ lazy_static = "1.4.0" | |
env_logger = "0.10.0" | ||
|
||
[dependencies.spider] | ||
version = "1.41.0" | ||
version = "1.41.1" | ||
path = "../spider" | ||
features = ["serde", "flexbuffers"] | ||
|
||
|