Skip to content

Commit

Permalink
Update nordvpn.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
irishmaestro authored Nov 3, 2023
1 parent dd65b18 commit 55e2fb8
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions src/nordvpn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,18 @@ use ansi_term::Color::{Green, Red, Yellow};
use august;

pub fn canary() {
let nordvpn_banner = r#" _ _ _ __ __ ___ _ _
| \| | ___ _ _ __| | \ \ / / | _ \ | \| |
| .` | / _ \ | '_| / _` | \ V / | _/ | .` |
|_|\_| \___/ _|_|_ \__,_| _\_/_ _|_|_ |_|\_|
_|"""""|_|"""""|_|"""""|_|"""""|_| """"|_| """ |_|"""""|
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://nordvpn.com/security-efforts/";
// 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() {
Expand All @@ -38,10 +39,18 @@ _|"""""|_|"""""|_|"""""|_|"""""|_| """"|_| """ |_|"""""|
}

let page = scraper::Html::parse_document(&response.text().unwrap());
let div = scraper::Selector::parse("div.my-11").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));
}

0 comments on commit 55e2fb8

Please sign in to comment.