Val Town Code SearchReturn to Val Town

API Access

You can access search results via JSON API by adding format=json to your query:

https://codesearch.val.run/$%7Bart_info.art.src%7D?q=fetch&page=1041&format=json

For typeahead suggestions, use the /typeahead endpoint:

https://codesearch.val.run/typeahead?q=fetch

Returns an array of strings in format "username" or "username/projectName"

Found 13090 results for "fetch"(1286ms)

printedWhiteToadmain.tsx1 match

@lazyplatypus•Updated 9 months ago
40
41 try {
42 const response = await fetch("/api/chat", {
43 method: "POST",
44 headers: { "Content-Type": "application/json" },

blobAdminmain.tsx3 matches

@psimyn•Updated 9 months ago
1/** @jsxImportSource https://esm.sh/hono@4.0.8/jsx **/
2
3import { modifyFetchHandler } from "https://esm.town/v/andreterron/codeOnValTown?v=50";
4import view_route from "https://esm.town/v/pomdtr/blob_admin_blob";
5import create_route from "https://esm.town/v/pomdtr/blob_admin_create";
137});
138
139export default modifyFetchHandler(
140 passwordAuth(app.fetch, { verifyPassword: (password) => password == Deno.env.get("VAL_PASSWORD") }),
141);

honEmeraldSnailmain.tsx1 match

@stevekrouse•Updated 9 months ago
104
105 try {
106 const response = await fetch("/api/chat", {
107 method: "POST",
108 headers: { "Content-Type": "application/json" },

selectHtmlmain.tsx5 matches

@yawnxyz•Updated 9 months ago
6import { JSDOM } from 'npm:jsdom';
7
8// Function to fetch HTML from a URL and remove <style> and <script> tags
9export async function fetchHtml(url, removeSelectors = "style, script, link, noscript, frame, iframe, comment") {
10 try {
11 const response = await fetch(url);
12 const html = await response.text();
13
17 return $.html();
18 } catch (error) {
19 console.error("Error fetching the URL:", error);
20 return null;
21 }
70 // url = "https://cnn.com";
71 let url = "https://softwareyoga.com/latency-numbers-everyone-should-know";
72 const cleanedHTML = await fetchHtml(url); // Fetch and clean the HTML
73
74 if (cleanedHTML) {

dailyDadJokemain.tsx2 matches

@rahulg•Updated 9 months ago
1import { email } from "https://esm.town/v/std/email";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
3
4export async function dailyDadJoke() {
5 let { setup, punchline } = await fetchJSON("https://official-joke-api.appspot.com/random_joke");
6 return email({
7 text: punchline,

virtualPetSimmain.tsx4 matches

@muhammad_owais_warsi•Updated 9 months ago
21
22 useEffect(() => {
23 fetchPet();
24 }, []);
25
26 const fetchPet = async () => {
27 const response = await fetch("/pet");
28 const data = await response.json();
29 setPet(data);
32
33 const interact = async (action) => {
34 const response = await fetch("/interact", {
35 method: "POST",
36 headers: { "Content-Type": "application/json" },

KidsCodingDameDinoAdventuremain.tsx5 matches

@jbwinters•Updated 9 months ago
81
82 useEffect(() => {
83 fetchHighScores();
84 }, []);
85
86 const fetchHighScores = async () => {
87 const response = await fetch('/highscores');
88 const scores = await response.json();
89 setHighScores(scores);
250
251 // Submit high score
252 await fetch('/highscore', {
253 method: 'POST',
254 headers: { 'Content-Type': 'application/json' },
255 body: JSON.stringify({ score: newScore })
256 });
257 fetchHighScores();
258 }, [grid, moves, score]);
259

honoJsxHtmlTemplatesmain.tsx1 match

@yawnxyz•Updated 9 months ago
44})
45
46export default app.fetch

getWeathermain.tsx2 matches

@escalona•Updated 9 months ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export async function getWeather(location: string): Promise<WeatherResponse> {
4 return fetchJSON(`https://wttr.in/${location}?format=j1`);
5}
6

sunsetNYCalendarmain.tsx1 match

@ejfox•Updated 9 months ago
107async function getSunsetTime(date: Date): Promise<Date> {
108 const formattedDate = `${date.getFullYear()}-${(date.getMonth() + 1).toString().padStart(2, '0')}-${date.getDate().toString().padStart(2, '0')}`;
109 const response = await fetch(`https://api.sunrise-sunset.org/json?lat=40.7128&lng=-74.0060&date=${formattedDate}&formatted=0`);
110
111 if (!response.ok) {

fetch-socials4 file matches

@welson•Updated 2 days ago
fetch and archive my social posts

fetchRssForSubcurrent2 file matches

@ashryanio•Updated 3 days ago