From cf31c70d323dcc07ff2e1b80b7df54b84c878f04 Mon Sep 17 00:00:00 2001 From: Nicolas DUBIEN Date: Mon, 2 Dec 2024 18:01:32 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=8A=20Basic=20tracking=20of=20Advent?= =?UTF-8?q?=20successes=20(#5463)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Just probing the usage of the Advent event. So that I can get an overall idea of how many people tried it. Not really tracking anything as it does not keep any details on the person, the answer that got submitted or anything else. --- .github/workflows/build-status.yml | 2 +- .../AdventOfTheDayBuilder.tsx | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-status.yml b/.github/workflows/build-status.yml index ffa80517..a34151a7 100644 --- a/.github/workflows/build-status.yml +++ b/.github/workflows/build-status.yml @@ -546,7 +546,7 @@ jobs: - name: Configure custom headers run: | echo "/*" > artifacts/_headers - echo " Content-Security-Policy: default-src 'none'; img-src 'self' data: badge.fury.io *.cloudfront.net img.shields.io raw.githubusercontent.com www.netlify.com api.securityscorecards.dev bestpractices.coreinfrastructure.org www.bestpractices.dev cdn.bsky.app;connect-src *.algolia.net *.algolianet.com public.api.bsky.app;script-src 'self' 'unsafe-inline' 'unsafe-eval';frame-src *.codesandbox.io www.youtube-nocookie.com; style-src 'self' 'unsafe-inline'; manifest-src 'self'; base-uri fast-check.dev;" >> artifacts/_headers + echo " Content-Security-Policy: default-src 'none'; img-src 'self' data: badge.fury.io *.cloudfront.net img.shields.io raw.githubusercontent.com www.netlify.com api.securityscorecards.dev bestpractices.coreinfrastructure.org www.bestpractices.dev cdn.bsky.app;connect-src *.algolia.net *.algolianet.com public.api.bsky.app api.counterapi.dev;script-src 'self' 'unsafe-inline' 'unsafe-eval';frame-src *.codesandbox.io www.youtube-nocookie.com; style-src 'self' 'unsafe-inline'; manifest-src 'self'; base-uri fast-check.dev;" >> artifacts/_headers echo "/api-reference/*" >> artifacts/_headers echo " Content-Security-Policy: default-src 'none'; img-src 'self' data:; connect-src data:; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline';" >> artifacts/_headers - name: Compress documentation artifacts as zip diff --git a/website/blog/2024-12-01-advent-of-pbt-day-1/AdventOfTheDayBuilder.tsx b/website/blog/2024-12-01-advent-of-pbt-day-1/AdventOfTheDayBuilder.tsx index 7a8b6858..26b420f0 100644 --- a/website/blog/2024-12-01-advent-of-pbt-day-1/AdventOfTheDayBuilder.tsx +++ b/website/blog/2024-12-01-advent-of-pbt-day-1/AdventOfTheDayBuilder.tsx @@ -77,6 +77,9 @@ export function buildAdventOfTheDay(options: Options) { } function onSubmit(event: React.SyntheticEvent) { + fetch(`https://api.counterapi.dev/v1/fast-check/AdventOfPBT2024Day${day}Attempt/up`) + .then((response) => response.json()) + .catch(() => {}); event.preventDefault(); try { const answer = extractAnswerFromForm(event); @@ -92,6 +95,9 @@ export function buildAdventOfTheDay(options: Options) { } lastError = null; localStorage.setItem(storageKey, answer); + fetch(`https://api.counterapi.dev/v1/fast-check/AdventOfPBT2024Day${day}Success/up`) + .then((response) => response.json()) + .catch(() => {}); } catch (err) { lastError = `Malformed inputs provided!\n${(err as Error).message}`; } -- 2.51.2