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/$%7Burl%7D?q=fetch&page=1002&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 13283 results for "fetch"(1332ms)

searchSectorsAppmain.tsx6 matches

@Fairestofthemall•Updated 6 months ago
29 const [error, setError] = useState(null);
30
31 // Fetch businesses from server
32 const fetchBusinesses = async () => {
33 setIsLoading(true);
34 setError(null);
35
36 try {
37 const response = await fetch(`/api/search?postcode=${postcode}&sector=${sector}`);
38
39 if (!response.ok) {
53 // Manual search function
54 const handleManualSearch = () => {
55 fetchBusinesses();
56 };
57
260 try {
261 // Use a business directory API (Replace with actual API)
262 const apiResponse = await fetch(`https://api.example.com/businesses?postcode=${postcode}&sector=${sector}`, {
263 headers: {
264 'Authorization': `Bearer ${API_KEY}`,
268
269 if (!apiResponse.ok) {
270 throw new Error('Failed to fetch businesses');
271 }
272

dns_record_debuggerREADME.md2 matches

@stevekrouse•Updated 6 months ago
3Proxied web browser for debugging new DNS records
4
5It's difficult to verify new DNS records. If you check too early, the old records may get cached on your computer, browser, or local network. This tool uses a proxied fetch so you can always view your web page uncached.
6
7Uses @std/fetch on the backend to ensure the DNS records of the request are from new places every request.
8
9Version 4 of this val also showed DNS records, pulled on the server,

big5PersonalityTestmain.tsx6 matches

@manyone•Updated 6 months ago
17 ];
18
19 // Endpoint to fetch questions
20 if (new URL(request.url).pathname === '/questions') {
21 return new Response(JSON.stringify(defaultQuestions), {
284
285 function completeQuiz() {
286 fetch('/submit', {
287 method: 'POST',
288 headers: { 'Content-Type': 'application/json' },
358
359 startButton.addEventListener('click', function() {
360 // Use absolute URL for fetching questions
361 fetch(window.location.origin + '/questions')
362 .then(function(response) {
363 console.log('Fetch response status:', response.status);
364 if (!response.ok) {
365 throw new Error('Network response was not ok');
375 })
376 .catch(function(error) {
377 logError('Error fetching questions', error);
378 });
379 });

createMovieSitemain.tsx6 matches

@temptemp•Updated 6 months ago
4const app = new Hono();
5
6async function fetchMovies(page = 1, limit = 20) {
7 const cacheKey = `movies_page_${page}_limit_${limit}`;
8
12 return cachedResponse;
13 }
14 const apiResponse = await fetch(
15 `https://api.zoechip.to/data/browse/?lang=3&keyword=&year=&rating=&votes=&genre=&country=&cast=&directors=&type=&order_by=trending&page=${page}&limit=${limit}`,
16 {
33 return data;
34 } catch (error) {
35 console.error("Failed to fetch movies:", error);
36 return { movies: [], pager: { totalPages: 0, currentPage: 1 } };
37 }
51app.get("/", async (c) => {
52 const page = Number(c.req.query("page") || "1");
53 const { movies, pager } = await fetchMovies(page);
54
55 return c.html(`
209app.get("/movie/:id", async (c) => {
210 const movieId = c.req.param("id");
211 const { movies } = await fetchMovies();
212 const movie = movies.find(m => m._id === movieId);
213
276});
277
278export default app.fetch;

valuableLavenderOpossummain.tsx4 matches

@ayaanpatel1790•Updated 6 months ago
1import { email } from "https://esm.town/v/std/email?v=9";
2
3// Fetches a random joke.
4async function fetchRandomJoke() {
5 const response = await fetch(
6 "https://official-joke-api.appspot.com/random_joke",
7 );
9}
10
11const randomJoke = await fetchRandomJoke();
12const setup = randomJoke.setup;
13const punchline = randomJoke.punchline;

libsqlstudiomain.tsx1 match

@spinningideas•Updated 6 months ago
4const app = createApp();
5
6export default lastlogin(app.fetch, {
7 verifyEmail: (email) => email === "spinningidea@gmail.com",
8});

getWeathermain.tsx2 matches

@lazynerdlab•Updated 6 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

cerebras_codermain.tsx1 match

@joyboy•Updated 6 months ago
23
24 try {
25 const response = await fetch("/", {
26 method: "POST",
27 body: JSON.stringify({ prompt, currentCode: code }),

exceptionalBlueMockingbirdmain.tsx4 matches

@elise_if•Updated 6 months ago
1import { email } from "https://esm.town/v/std/email?v=9";
2
3// Fetches a random joke:
4async function fetchRandomJoke() {
5 const response = await fetch(
6 "https://official-joke-api.appspot.com/random_joke",
7 );
9}
10
11const randomJoke = await fetchRandomJoke();
12const setup = randomJoke.setup;
13const punchline = randomJoke.punchline;

pageshotmain.tsx3 matches

@yawnxyz•Updated 6 months ago
64
65 console.log(">>>> Data", data)
66 const response = await fetch(pipeline_url, {
67 method: "POST",
68 headers: {
302 }
303
304 const response = await fetch('/pageshot', {
305 method: 'POST',
306 headers: {
559app.post("/pageshot", pageshotHandler);
560
561export default (typeof Deno !== "undefined" && Deno.env.get("valtown")) ? app.fetch : app;
562

GithubPRFetcher

@andybak•Updated 18 hours ago

proxiedfetch1 file match

@jayden•Updated 1 day ago