diff options
Diffstat (limited to 'src/pre_process.rs')
-rw-r--r-- | src/pre_process.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/pre_process.rs b/src/pre_process.rs new file mode 100644 index 0000000..aa55bd8 --- /dev/null +++ b/src/pre_process.rs | |||
@@ -0,0 +1,13 @@ | |||
1 | pub fn strip_irrelevant_content(s: &str) -> String { | ||
2 | let mut retn = ""; | ||
3 | match s.find(r#"<div class=profile id=profile>"#) { | ||
4 | Some(pos) => retn = &s[pos..], | ||
5 | None => (), | ||
6 | }; | ||
7 | |||
8 | match s.find(r#"<INPUT style="font-size: 2em;" TYPE=SUBMIT NAME="votes" VALUE="Cast Votes">"#) { | ||
9 | Some(pos) => retn = &s[..pos], | ||
10 | None => (), | ||
11 | }; | ||
12 | return retn.into(); | ||
13 | } \ No newline at end of file | ||