Skip to content

Commit

Permalink
🔊 Basic tracking of Advent successes (#5463)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dubzzz authored Dec 2, 2024
1 parent f1ace00 commit cf31c70
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/build-status.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ export function buildAdventOfTheDay(options: Options) {
}

function onSubmit(event: React.SyntheticEvent<HTMLFormElement>) {
fetch(`https://api.counterapi.dev/v1/fast-check/AdventOfPBT2024Day${day}Attempt/up`)
.then((response) => response.json())
.catch(() => {});
event.preventDefault();
try {
const answer = extractAnswerFromForm(event);
Expand All @@ -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}`;
}
Expand Down

0 comments on commit cf31c70

Please sign in to comment.