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=1&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 7896 results for "fetch"(915ms)

telegramBotStarterindex.ts3 matches

@asdfg•Updated 21 mins ago
349 const botToken = process.env.TELEGRAM_BOT_TOKEN;
350
351 const response = await fetch(`https://api.telegram.org/bot${botToken}/sendMessage`, {
352 method: "POST",
353 headers: { "Content-Type": "application/json" },
379 const botToken = process.env.TELEGRAM_BOT_TOKEN;
380
381 const response = await fetch(`https://api.telegram.org/bot${botToken}/setWebhook`, {
382 method: "POST",
383 headers: { "Content-Type": "application/json" },
403 const botToken = process.env.TELEGRAM_BOT_TOKEN;
404
405 const response = await fetch(`https://api.telegram.org/bot${botToken}/getWebhookInfo`);
406 const result = await response.json();
407 return result;

maine-bills-taxsearch.ts2 matches

@cmknz•Updated 2 hours ago
1import { SearchResult } from "https://esm.town/v/cmknz/maine-bills-tax/types.ts";
2import { fetchText } from "https://esm.town/v/stevekrouse/fetchText?v=6";
3
4// Inject the search term in to the URL
9// Query the Maine bill database
10export function search(term: string): Promise<SearchResult[]> {
11 return fetchText(getSearchURL(term)).then((res) => {
12 return JSON.parse(res).hits.hits;
13 }) as Promise<SearchResult[]>;
19
20 // Used to get the list of post id's for the discussion.
21 const discussionRes = await fetch(`${server}/api/discussions/${discussionId}`);
22 const discussionResJson = await discussionRes.json();
23
31
32 await Promise.all(chunks.map(async (c: string[]) => {
33 const postRes = await fetch(`${server}/api/posts?filter[id]=${c.join(",")}`);
34 const postJson = await postRes.json();
35

productpaneldashboard.http.ts3 matches

@tijs•Updated 3 hours ago
435 queryParams.append('offset', ((pagination.value.currentPage - 1) * pagination.value.limit).toString());
436
437 const response = await fetch('/getFeedback?' + queryParams.toString(), {
438 headers: {
439 'Authorization': getAuthHeader()
494 const createApp = async () => {
495 try {
496 const response = await fetch('/createApp', {
497 method: 'POST',
498 headers: {
531 const deleteApp = async (appId) => {
532 try {
533 const response = await fetch('/deleteApp?id=' + appId, {
534 method: 'DELETE',
535 headers: {

sqliteExplorerAppmain.tsx4 matches

@cmknz•Updated 3 hours ago
1/** @jsxImportSource npm:hono/jsx **/
2
3import { modifyFetchHandler } from "https://esm.town/v/andreterron/codeOnValTown?v=50";
4import { iframeHandler } from "https://esm.town/v/nbbaier/iframeHandler";
5import { resetStyle } from "https://esm.town/v/nbbaier/resetStyle";
16import { verifyToken } from "https://esm.town/v/pomdtr/verifyToken";
17import { ResultSet, sqlite } from "https://esm.town/v/std/sqlite";
18import { reloadOnSaveFetchMiddleware } from "https://esm.town/v/stevekrouse/reloadOnSave";
19import { Hono } from "npm:hono";
20import type { FC } from "npm:hono/jsx";
175});
176
177export const handler = app.fetch;
178export default iframeHandler(modifyFetchHandler(passwordAuth(handler, { verifyPassword: verifyToken })));

productpanelimplementation-guides.mdc2 matches

@tijs•Updated 4 hours ago
60// Example client-side code for submitting feedback
61async function submitFeedback(rating, comment) {
62 const response = await fetch('https://username-submitFeedback.web.val.run', {
63 method: 'POST',
64 headers: {
88const submitFeedback = async (apiKey, rating, comment) => {
89 try {
90 const response = await fetch('https://username-submitFeedback.web.val.run', {
91 method: 'POST',
92 headers: {

gztxtmain.tsx1 match

@g•Updated 5 hours ago
33app.get("/10gb", s(get10gb));
34
35export default app.fetch;
36
37function fromB64(str: string): Uint8Array {

statusmonitor2 matches

@Grace•Updated 5 hours ago
15 const start = performance.now();
16 try {
17 res = await fetch(url);
18 end = performance.now();
19 status = res.status;
25 } catch (e) {
26 end = performance.now();
27 reason = `couldn't fetch: ${e}`;
28 ok = false;
29 }

untitled-8543new-file-2816.tsx1 match

@Gj64•Updated 5 hours ago
48 },
49 vertexShader:`varying vec2 vUv; void main(){vUv=uv;gl_Position=vec4(position,1.);}`,
50 fragmentShader: await (await fetch('data:text/plain,'+encodeURIComponent(`
51/* WGSL-like GLSL fragment shader: traces one null geodesic per pixel */
52/* Kerr–Newman metric helpers ------------------------------------------- */

cerebras_coderindex.ts1 match

@Lama•Updated 6 hours ago
181
182 try {
183 const response = await fetch("/", {
184 method: "POST",
185 body: JSON.stringify({

fetchPaginatedData2 file matches

@nbbaier•Updated 1 week ago

FetchBasic1 file match

@fredmoon•Updated 1 week ago