diff --git a/homegrown/email/src/main.rs b/homegrown/email/src/main.rs index a39865a..99f3ae5 100644 --- a/homegrown/email/src/main.rs +++ b/homegrown/email/src/main.rs @@ -1,4 +1,5 @@ use serde::Deserialize; +use std::env; #[derive(Deserialize)] struct Channel { @@ -20,9 +21,12 @@ async fn main() { // Ok(text) => text, // Err(error) => println!("NOPE"), // }; // - let channels =serde_json::from_str::>(&resp).unwrap(); + let channels = serde_json::from_str::>(&resp).unwrap(); + let APIKEY = env::var("APIKEY").unwrap(); for i in channels { - println!{"{:#?}", i.name}; + let ID = i.id; + let videosRequest = format!("https://www.googleapis.com/youtube/v3/channels?id={ID}&key={APIKEY}&part=contentDetails"); + println!("{}", videosRequest); } }