diff options
author | jan <jan@ruken.pw> | 2016-09-25 20:28:51 (UTC) |
---|---|---|
committer | jan <jan@ruken.pw> | 2016-09-25 20:28:51 (UTC) |
commit | 265ea9e217f15ef387a5580d9b21a1914308389c (patch) | |
tree | a53a6c98e5e302e7712b55c03d5bdd11bf497471 /src/pre_process.rs |
initial commit
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 | ||