aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/main.rs b/src/main.rs
index b733e6f..2123c6b 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -13,15 +13,11 @@ mod pre_process;
13use pre_process::Section; 13use pre_process::Section;
14 14
15fn main() { 15fn main() {
16 let raw_files = env::var("RAW_FILES").unwrap_or("S:\\grilist\\acd\\acd_character_parser\\characters\\".into()); 16 let raw_files = env::var("RAW_FILES").unwrap_or("characters".into());
17 let base_path = Path::new(&raw_files); 17 let base_path = Path::new(&raw_files);
18 18
19 let mut sections: Vec<Section> = vec![]; 19 let mut sections: Vec<Section> = vec![];
20 sections.push(Section { 20 sections.push(Section::new("image", r#"(?is)<H3 id="section99">.*<img src="(.*?)" alt=.*?></a><p><a href="(.*?)">View Full Size Image"#, vec!["thumb".into(), "full".into()]));
21 name: "image".into(),
22 re: Regex::new(r#"(?is)<H3 id="section99">.*<p><a href="(.*?)">View Full Size Image"#).unwrap(),
23 content: String::new(),
24 });
25 21
26 for entry in WalkDir::new(base_path).min_depth(1).into_iter().filter_map(|e| e.ok()) { 22 for entry in WalkDir::new(base_path).min_depth(1).into_iter().filter_map(|e| e.ok()) {
27 let mut f = File::open(entry.path()).expect("could not open file"); 23 let mut f = File::open(entry.path()).expect("could not open file");
@@ -35,6 +31,6 @@ fn main() {
35 31
36 pre_process::split_sections(&buf, &mut sections); 32 pre_process::split_sections(&buf, &mut sections);
37 33
38 println!("{}", sections[0].content); 34 println!("{:?}", sections[0].data);
39 } 35 }
40} 36}