mod db; mod parse; mod types; use std::{fs::File, io::Read}; use parse::parse; fn main() -> Result<(), Box> { env_logger::init(); let html = read("test_mordit.html")?; parse(&html); Ok(()) } fn _download_file(url: &str, _path: &str) -> Result> { // Some simple CLI args requirements... eprintln!("Fetching {url:?}..."); // reqwest::blocking::get() is a convenience function. // // In most cases, you should create/build a reqwest::Client and reuse // it for all requests. let res = reqwest::blocking::get(url)?; let body = res.text()?; Ok(body) } fn read(path: &str) -> Result { let mut file = File::open(path)?; let mut contents = String::new(); file.read_to_string(&mut contents)?; Ok(contents) }