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/$1?q=fetch&page=31&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 13469 results for "fetch"(1741ms)

digest_Bolivia_RGupdateNews7 matches

@strysg•Updated 2 days ago
1import { fetch } from "https://esm.town/v/std/fetch";
2import { parseXML } from "https://esm.town/v/stevekrouse/parseXML";
3let { parse } = await import("npm:node-html-parser");
13 console.log("Old Items", oldItems);
14
15 // Fetch each source, filter unseen news items
16 for (const source of sources) {
17 const sourceItems = await fetchSource(source, oldItems, descMaxLength);
18 newItems = { ...newItems, ...sourceItems };
19 }
28}
29
30async function fetchSource(url: string, oldItems: any, descMaxLength: number) {
31 // Fetch a source, filter unseen news items
32 console.log(`fetch: ${url}`);
33
34 function parseDescription(description: string, maxlength: number) {
55 const hostname = new URL(url).hostname || "";
56 const oldLinks = new Set(Object.keys(oldItems));
57 const response = await fetch(url, { signal: AbortSignal.timeout(5000) });
58 const responseJSON = await parseXML(await response.text());
59 const items = responseJSON.rss.channel.item.filter(

notesmain.tsx2 matches

@cosmopaolo•Updated 2 days ago
85 async load(force) {
86 try {
87 const res = await fetch('?api=1');
88 const data = await res.json();
89 // Only overwrite local if we have no unsaved edits, or we're forcing (first load)
111 this.status = 'Saving...';
112 try {
113 const res = await fetch('', {
114 method: 'POST',
115 headers: { 'Content-Type': 'application/json' },

altaroc-mapboxscript.js1 match

@ncf•Updated 2 days ago
31function getAuthorizedPoints() {
32 console.log("Début getAuthorizedPoints - authorizedVehicles:", authorizedVehicles);
33 fetch("https://xnyx-ex15-ndvx.n7.xano.io/api:_aqWQ_f_/cached_mapCompanies", {
34 method: "POST",
35 headers: {

MiniAppStarterimage.tsx2 matches

@moe•Updated 2 days ago
76 const fontPromises = fontsConfig.map(async (font) => {
77 const fontUrl = 'https://cdn.jsdelivr.net/npm/@tamagui/font-inter@1.108.3/otf/' + font.fontFile
78 const fontArrayBuf = await fetch(fontUrl).then((res) => res.arrayBuffer())
79 return { name: font.name, data: fontArrayBuf, weight: font.weight }
80 })
87 // const api = `https://cdnjs.cloudflare.com/ajax/libs/twemoji/14.0.2/svg/${code.toLowerCase()}.svg`
88 const api = `https://cdn.jsdelivr.net/gh/shuding/fluentui-emoji-unicode/assets/${code.toLowerCase()}_color.svg`
89 return fetch(api).then((r) => r.text())
90}
91

markdown-embedrecordClick.ts1 match

@stevekrouse•Updated 2 days ago
7 console.log("click: ", JSON.stringify(clickData));
8
9 fetch("/api/action", {
10 method: "POST",
11 headers: {

markdown-embedREADME.md2 matches

@stevekrouse•Updated 2 days ago
17 let html = await readFile("/frontend/index.html", import.meta.url);
18
19 const response = await fetch(`/api/demo/${id}`);
20 const initialData = await response.json();
21
87// Client-side event recording
88window.recordClick = function (action) {
89 fetch(`/api/setAction`, {
90 method: "POST",
91 headers: { "Content-Type": "application/json" },

markdown-embedpollEnabledStatus.ts1 match

@stevekrouse•Updated 2 days ago
7 const pinger = setInterval(async () => {
8 // check the boolean to see if a Glancer has enabled the link to start a cobrowsing session
9 const resp = await fetch("/api/cobrowse/" + window.__DEMO_ID__, {
10 method: "GET",
11 headers: {

markdown-embedindex.tsx2 matches

@stevekrouse•Updated 2 days ago
60 }
61
62 // If no initial data, fetch it from the API
63 const demoId = window.__DEMO_ID__ || getDemoIdFromPath();
64 if (demoId && demoId !== 'demo') {
65 try {
66 const response = await fetch(`/api/demo/${demoId}`);
67 const data = await response.json();
68 return {

markdown-embedindex.ts1 match

@stevekrouse•Updated 2 days ago
44});
45
46export default app.fetch;
47

markdown-embeddemo.ts1 match

@stevekrouse•Updated 2 days ago
30 // const apiUrl = new URL(c.req.url);
31 // apiUrl.pathname = `/api/demo/${id}`;
32 // const response = await fetch(apiUrl.toString());
33 const page = await getPage(id);
34

GithubPRFetcher

@andybak•Updated 2 days ago

proxiedfetch1 file match

@jayden•Updated 3 days ago