From 8af3252278da74c163063396831515f2f6a2eab1 Mon Sep 17 00:00:00 2001 From: Joey Hines Date: Sun, 5 May 2019 09:42:14 -0500 Subject: [PATCH] Committed some changes --- .gitignore | 4 +++- drm/Cargo.toml | 8 ++++++++ drm/src/main.rs | 23 +++++++++++++++++++++++ 3 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 drm/Cargo.toml create mode 100644 drm/src/main.rs diff --git a/.gitignore b/.gitignore index 7e7f2c3..a175aa8 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,6 @@ CMakeLists.txt /venv/* *.zip /jasmin-2.4/* -hash.txt \ No newline at end of file +hash.txt +/drm/target/* +/drm/Cargo.lock \ No newline at end of file diff --git a/drm/Cargo.toml b/drm/Cargo.toml new file mode 100644 index 0000000..848ad36 --- /dev/null +++ b/drm/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "drm" +version = "0.1.0" +authors = ["Joey Hines "] +edition = "2018" + +[dependencies] +reqwest = "0.9.16" diff --git a/drm/src/main.rs b/drm/src/main.rs new file mode 100644 index 0000000..4317522 --- /dev/null +++ b/drm/src/main.rs @@ -0,0 +1,23 @@ +extern crate reqwest; + +use reqwest::Error; +use std::time::Duration; +use reqwest::ClientBuilder; + + +fn main() -> Result<(), Error> { + let request_url = "https://www.ea.com"; + println!("{}", request_url); + + let timeout = Duration::new(5, 0); + let client = ClientBuilder::new().timeout(timeout).build()?; + let response = client.head(request_url).send()?; + + if response.status().is_success() { + println!("ea found"); + } else { + println!("ea not found"); + } + + Ok(()) +}