From 0ff3c7a22817af1fca906fb0848dbd1046c1eb41 Mon Sep 17 00:00:00 2001 From: Joe Clay <27cupsofcoffee@gmail.com> Date: Thu, 21 Apr 2022 12:53:38 +0100 Subject: [PATCH 1/2] Reduce load on Crates.io --- templates/categories/macros.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/categories/macros.html b/templates/categories/macros.html index ad8b8a48..97a1558e 100644 --- a/templates/categories/macros.html +++ b/templates/categories/macros.html @@ -6,7 +6,7 @@ {% if item.source %} {% if item.source == 'crates' %} - {% set data = load_data(url = "https://crates.io/api/v1/crates/" ~ item.name, format="json") %} + {% set data = load_data(url = "https://crates.io/api/v1/crates/" ~ item.name ~ "?include=", format="json", headers=["User-Agent=arewegameyet"]) %} {# human readable name #} {% set name = data.crate.name %} {# Github/Gitlab/Etc. repository #} From 86dec703203245daeb0b20be3b3a2e48394d88d4 Mon Sep 17 00:00:00 2001 From: Joe Clay <27cupsofcoffee@gmail.com> Date: Thu, 21 Apr 2022 15:50:38 +0100 Subject: [PATCH 2/2] Update macros.html --- templates/categories/macros.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/categories/macros.html b/templates/categories/macros.html index 97a1558e..1196cdb5 100644 --- a/templates/categories/macros.html +++ b/templates/categories/macros.html @@ -6,7 +6,7 @@ {% if item.source %} {% if item.source == 'crates' %} - {% set data = load_data(url = "https://crates.io/api/v1/crates/" ~ item.name ~ "?include=", format="json", headers=["User-Agent=arewegameyet"]) %} + {% set data = load_data(url = "https://crates.io/api/v1/crates/" ~ item.name ~ "?include=", format="json", headers=["User-Agent=arewegameyet (gamedev-wg@rust-lang.org)"]) %} {# human readable name #} {% set name = data.crate.name %} {# Github/Gitlab/Etc. repository #}