chore: define rust channel (+ fmt)
This commit is contained in:
parent
815c08cc36
commit
4acaf0308c
2
rust-toolchain.toml
Normal file
2
rust-toolchain.toml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
[toolchain]
|
||||||
|
channel = "nightly"
|
@ -21,7 +21,6 @@ async fn main() -> ExitCode {
|
|||||||
let mut page = 0;
|
let mut page = 0;
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
|
|
||||||
println!("now scraping page {}", page + 1);
|
println!("now scraping page {}", page + 1);
|
||||||
|
|
||||||
let post_html = async || {
|
let post_html = async || {
|
||||||
@ -45,7 +44,6 @@ async fn main() -> ExitCode {
|
|||||||
let mut wait_time = 5000;
|
let mut wait_time = 5000;
|
||||||
|
|
||||||
if urls.is_empty() {
|
if urls.is_empty() {
|
||||||
|
|
||||||
for reconnection_attempts in 0..4 {
|
for reconnection_attempts in 0..4 {
|
||||||
println!("no urls found, retrying in {} seconds...", wait_time / 1000);
|
println!("no urls found, retrying in {} seconds...", wait_time / 1000);
|
||||||
sleep(Duration::from_millis(wait_time)).await;
|
sleep(Duration::from_millis(wait_time)).await;
|
||||||
@ -67,7 +65,6 @@ async fn main() -> ExitCode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for url in urls {
|
for url in urls {
|
||||||
|
|
||||||
let img_url =
|
let img_url =
|
||||||
extract_img_url(&client.get(url).send().await.unwrap().text().await.unwrap());
|
extract_img_url(&client.get(url).send().await.unwrap().text().await.unwrap());
|
||||||
if img_url.is_empty() {
|
if img_url.is_empty() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user