25// the weakest possible implementation so it seems like no one really
26// cares about it.
27const response = await fetch(`https://gql.twitch.tv/gql`, {
28method: "POST",
29headers: {
2425try {
26const response = await fetch('/research', {
27method: 'POST',
28headers: { 'Content-Type': 'application/json' },
emailRandomJokemain.tsx4 matches
1import { email } from "https://esm.town/v/std/email?v=9";
23// Fetches a random joke.
4async function fetchRandomJoke() {
5const response = await fetch(
6"https://official-joke-api.appspot.com/random_joke",
7);
11// Parses the response from the joke API.
1213const randomJoke = await fetchRandomJoke();
14const setup = randomJoke.setup;
15const punchline = randomJoke.punchline;
unbeatableWhiteAnteatermain.tsx4 matches
1import { email } from "https://esm.town/v/std/email?v=9";
23// Fetches a random joke.
4async function fetchRandomJoke() {
5const response = await fetch(
6"https://official-joke-api.appspot.com/random_joke",
7);
9}
1011const randomJoke = await fetchRandomJoke();
12const setup = randomJoke.setup;
13const punchline = randomJoke.punchline;
1import { email } from "https://esm.town/v/std/email?v=9";
23// Fetches a random joke.
4async function fetchRandomJoke() {
5const response = await fetch(
6"https://official-joke-api.appspot.com/random_joke",
7);
9}
1011const randomJoke = await fetchRandomJoke();
12const setup = randomJoke.setup;
13const punchline = randomJoke.punchline;
JokeGeneratormain.tsx4 matches
1import { email } from "https://esm.town/v/std/email?v=9";
23// Fetches a random joke.
4async function fetchRandomJoke() {
5const response = await fetch(
6"https://official-joke-api.appspot.com/random_joke",
7);
9}
1011const randomJoke = await fetchRandomJoke();
12const setup = randomJoke.setup;
13const punchline = randomJoke.punchline;
festiveBlushRoundwormmain.tsx7 matches
1import { email } from "https://esm.town/v/std/email?v=9";
23// Fetches a random joke.
4// Fetches a random joke.
5// Fetches a random joke.
6// Fetches a random joke.
7async function fetchRandomJoke() {
8const response = await fetch(
9"https://official-joke-api.appspot.com/random_joke",
10);
12}
1314const randomJoke = await fetchRandomJoke();
15const setup = randomJoke.setup;
16const punchline = randomJoke.punchline;
ThankYouNoteGeneratormain.tsx2 matches
67setError("");
68try {
69const response = await fetch("/generate", {
70method: "POST",
71headers: { "Content-Type": "application/json" },
194onClick={async () => {
195try {
196const response = await fetch(`/update/${noteId}`, {
197method: "POST",
198headers: { "Content-Type": "application/json" },
accomplishedBeigeGuineafowlmain.tsx3 matches
1async function fetchRandomJoke() {
2const response = fetch(
3"https://official-joke-api.appspot.com/random_joke",
4);
8import { email } from "https://esm.town/v/std/email?v=9";
910const randomJoke = fetchRandomJoke();
11const setup = randomJoke.setup;
12const punchline = randomJoke.punchline;
fullWebsiteCheckermain.tsx19 matches
52}
5354// Link Fetching Helper
55export class LinkFetcher {
56static discoveredUrls = new Set();
5758static async fetchLinksFromWebsite(websiteUrl, maxDepth = 5, currentDepth = 0) {
59if (currentDepth >= maxDepth) {
60return [];
6263currentProgress = {
64phase: "fetching",
65processedPages: 0,
66totalLinks: 0,
75while (pagesToProcess.length > 0) {
76currentProgress = {
77phase: "fetching",
78processedPages: processedPages.size,
79totalLinks: allLinks.length,
89try {
90const startTime = Date.now();
91const response = await fetch(pageUrl, {
92headers: {
93"User-Agent":
97const elapsed = Date.now() - startTime;
98if (elapsed > 3000) {
99console.log(`Slow page fetch: ${pageUrl} took ${elapsed / 1000} seconds`);
100}
101102if (!response.ok) {
103console.log(`Failed to fetch page: ${pageUrl}`);
104return [];
105}
136137processedPages.add(pageUrl);
138const nestedLinks = await this.fetchLinksFromWebsite(pageUrl, maxDepth, currentDepth + 1);
139return [...pageLinks, ...nestedLinks];
140} catch (error) {
150console.log(`Checkpoint: ${processedPages.size} total pages found, ${allLinks.length} total links`);
151currentProgress = {
152phase: "fetching",
153processedPages: processedPages.size,
154totalLinks: allLinks.length,
223for (let attempt = 0; attempt < retries; attempt++) {
224try {
225const response = await fetch(url, {
226method: "GET",
227headers: {
461try {
462console.log(`Starting link check for ${websiteUrl}`);
463const links = await LinkFetcher.fetchLinksFromWebsite(websiteUrl);
464console.log(`Fetched ${links.length} links from ${websiteUrl}`);
465const totalPages = new Set(links.map(link =>
466new URL(link.link, websiteUrl).origin + new URL(link.link, websiteUrl).pathname
500intervalId = setInterval(async () => {
501try {
502const response = await fetch("/api/progress");
503if (!response.ok) {
504throw new Error(`HTTP error! status: ${response.status}`);
508setProgress(data);
509} catch (e) {
510console.error("Error fetching progress:", e);
511setError(`Error fetching progress: ${e.message}`);
512}
513}, 1000);
523setError(null);
524try {
525const response = await fetch("/api/check-links", {
526method: "POST",
527headers: {
593<h2>Progress</h2>
594<p>Phase: {progress.phase}</p>
595{progress.phase === "fetching" && (
596<p>
597Processed Pages: {progress.processedPages}
733const maxDepth = 5;
734currentProgress = {
735phase: "fetching",
736processedPages: 0,
737totalLinks: 0,