From 0e2ca5bcd11b5f6b7e1c6b9ae8ee5c37cd09d894 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Tue, 16 Aug 2022 16:07:58 +0200 Subject: [PATCH] add comments --- src/info.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/info.rs b/src/info.rs index 4c9ad92..a944d87 100644 --- a/src/info.rs +++ b/src/info.rs @@ -61,7 +61,11 @@ pub async fn info() -> HashMap, i64)>> { async fn get_webpage() -> Result> { let url = "https://informatique.up8.edu/licence-iv/edt"; - let client = reqwest::Client::builder().user_agent("bypass-rate_limit").build()?; + // We don't use reqwest::get() but a client with a custom user-agent + // in order to avoid getting rate limit + let client = reqwest::Client::builder() + .user_agent("bypass-rate_limit") + .build()?; let html = client.get(url).send().await?.text().await?; // Panic on error