Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use std::io::{self, BufRead};
- fn main() {
- let stdin = io::stdin();
- let mut content_length = 0;
- let mut warc_url = "";
- for line_wrapped in stdin.lock().lines() {
- let line = line_wrapped.unwrap();
- if line.starts_with("Content-Length: ") {
- content_length = line.split("Content-Length: ").nth(1).unwrap().parse().unwrap();
- } else if line.starts_with("WARC-Target-URI: ") {
- warc_url = line.split("WARC-Target-URI: ").nth(1).unwrap().clone();
- }
- }
- }
Add Comment
Please, Sign In to add comment