init
This commit is contained in:
26
src/main.rs
Normal file
26
src/main.rs
Normal file
@@ -0,0 +1,26 @@
|
||||
use std::thread;
|
||||
|
||||
use std::time::Duration;
|
||||
|
||||
|
||||
mod file;
|
||||
mod web_parser;
|
||||
|
||||
|
||||
fn main() {
|
||||
let mut continue_flag = true;
|
||||
let mut idx: i32 = 1;
|
||||
while continue_flag {
|
||||
let name = web_parser::get_title(idx);
|
||||
if name == "" {
|
||||
continue_flag = false;
|
||||
} else {
|
||||
web_parser::download_images(idx, &name);
|
||||
}
|
||||
thread::sleep(Duration::from_millis(300));
|
||||
idx += 1;
|
||||
if idx > 3 {
|
||||
continue_flag = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user