diff --git a/src/surfshark.rs b/src/surfshark.rs index a7e62d3..9cb3c6f 100644 --- a/src/surfshark.rs +++ b/src/surfshark.rs @@ -2,17 +2,18 @@ use ansi_term::Color::{Green, Red, Yellow}; use august; pub fn canary() { - let surfshark_banner = r#" ___ __ _ _ - / __| _ _ _ _ / _| ___ | |_ __ _ _ _ | |__ - \__ \ | +| | | '_| | _| (_-< | ' \ / _` | | '_| | / / - |___/ \_,_| _|_|_ _|_|_ /__/_ |_||_| \__,_| _|_|_ |_\_\ -_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""| -"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-' "#; - println!("{}", surfshark_banner); - println!(";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"); + let nordvpn_banner = r#" _ _ _ __ __ ___ _ _ + | \| | ___ _ _ __| | \ \ / / | _ \ | \| | + | .` | / _ \ | '_| / _` | \ V / | _/ | .` | + |_|\_| \___/ _|_|_ \__,_| _\_/_ _|_|_ |_|\_| +_|"""""|_|"""""|_|"""""|_|"""""|_| """"|_| """ |_|"""""| +"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-' "#; + println!("{}", nordvpn_banner); + println!(";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"); println!("\n"); - let url = "https://surfshark.com/warrant-canary"; + // let url = "https://nordvpn.com/security-efforts/"; + let url = "https://nordvpn.com/blog/nordvpn-introduces-a-warrant-canary/"; let response = reqwest::blocking::get(url).unwrap(); if response.status().is_success() { @@ -23,14 +24,14 @@ _|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""| ); } else if response.status().is_server_error() { println!( - "HTTP STATUS CODE: {:?}\n{}\nVISIT {} FOR FURTHER CONFIRMATION", + "HTTP STATUS CODE: {:?}\n{}\nVISIT {} FOR FURTHER CONFIRMATION.", response.status(), Red.bold().paint("CANARY DOWN"), url ); } else { println!( - "HTTP STATUS CODE: {:?}\n{}\nVISIT {} FOR FURTHER CONFIRMATION", + "HTTP STATUS CODE: {:?}\n{}\nVISIT {} FOR FURTHER CONFIRMATION.", response.status(), Yellow.bold().paint("CANARY UNKNOWN"), url @@ -38,10 +39,18 @@ _|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""| } let page = scraper::Html::parse_document(&response.text().unwrap()); - let div = scraper::Selector::parse("div.styles_col12__Y_5s1").unwrap(); + let div = scraper::Selector::parse("div.BlogPost__content").unwrap(); let canary = page.select(&div).next().unwrap(); - println!("🐤 {}", august::convert(&canary.inner_html(), 80)); + let full = august::convert(&canary.inner_html(), 80); + let rm_rf_sales_pitch = full.as_str().get(0..1638); + println!( + "🐤 {}", + rm_rf_sales_pitch.unwrap_or( + "ERROR PULLING CANARY: VISIT THE FOLLOWING URL TO MANUALLY VERIFY CANARY STATUS" + ) + ); + println!("\n"); println!("🐤 {}", Yellow.bold().paint(url)); }