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/?q=fetch&page=634&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 8298 results for "fetch"(1704ms)

buildclubProjectSearchmain.tsx3 matches

@yawnxyz•Updated 11 months ago
65const defaultEmbeddingColumn = "Embeddings";
66
67async function fetchAirtableData(baseId, tableName, nameColumn, contentColumn, embeddingColumn) {
68 const base = new Airtable({ apiKey: airtableApiKey }).base(baseId);
69 const records = await base(tableName).select().all();
86
87 try {
88 const documents = await fetchAirtableData(baseId, tableName, nameColumn, contentColumn, embeddingColumn);
89 console.log('documents:', documents)
90 await semanticSearch.addDocuments({documents, fields: 'embeddingsContent'});
132});
133
134export default app.fetch;
135

airtablesemanticsearchmain.tsx4 matches

@yawnxyz•Updated 11 months ago
18const defaultEmbeddingColumn = "Embeddings";
19
20async function fetchAirtableData(baseId, tableName, contentColumn, embeddingColumn) {
21 const base = new Airtable({ apiKey: airtableApiKey }).base(baseId);
22 const records = await base(tableName).select().all();
41
42 try {
43 const documents = await fetchAirtableData(baseId, tableName, contentColumn, embeddingColumn);
44 await semanticSearch.addDocuments(documents);
45
63
64 try {
65 const documents = await fetchAirtableData(baseId, tableName, contentColumn, embeddingColumn);
66 await semanticSearch.addDocuments(documents);
67
74});
75
76export default app.fetch;

imageDownSizermain.tsx2 matches

@yawnxyz•Updated 11 months ago
8
9function esmTown(url) {
10 return fetch(url, {
11 headers: {
12 "User-Agent":
17
18const app = new Hono();
19export default app.fetch;
20
21app.get("/", async (c) =>

tealRattlesnakemain.tsx1 match

@pomdtr•Updated 11 months ago
14});
15
16export default app.fetch;

blob_adminmain.tsx2 matches

@Daniel•Updated 11 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";
153});
154
155export default modifyFetchHandler(passwordAuth(app.fetch));

telegrammain.tsx1 match

@austinm911•Updated 11 months ago
25
26async function telegramRequest(path, body, authorization?: string) {
27 const response = await fetch("https://stevekrouse-telegramValTownAPI.web.val.run/" + path, {
28 method: "POST",
29 body: JSON.stringify(body),

guestmain.tsx1 match

@pomdtr•Updated 11 months ago
1export default function() {
2 return fetch("file:///opt/render/project/src/guest/index.ts");
3}

openAQLocationmain.tsx2 matches

@stevekrouse•Updated 11 months ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2import { msDay } from "https://esm.town/v/stevekrouse/msDay";
3
6 lon: number;
7}) => {
8 const { results } = await fetchJSON(
9 "https://api.openaq.org/v2/locations?"
10 + new URLSearchParams({

API_URLREADME.md1 match

@pomdtr•Updated 11 months ago
8import { API_URL } from "https://esm.town/v/std/API_URL";
9
10const response = await fetch(`${API_URL}/v1/me`, {
11 headers: {
12 Authorization: `Bearer ${Deno.env.get("valtown")}`,

HTreeTreePmain.tsx14 matches

@maxm•Updated 11 months ago
32}`;
33
34const DEFAULT_REQUEST = `let resp = await fetch("http://localhost");
35const logIt = () => {
36 console.log(resp.status);
95 work.onmessage = (e) => {
96 try {
97 const resp: { logs: Log[]; error?: { message: string; stack: string }; requests: FetchInfo[] } = JSON.parse(
98 e.data,
99 );
133 );
134 }
135 async handleRequest(req: Request, requestId: string, fetchId: string): Promise<Response> {
136 let requestRow = parseResultSet<RequestRow>(
137 await sqlite.execute({
167 await sqlite.execute({
168 sql: `UPDATE requests SET handler_logs = json_insert(handler_logs, '$[#]',json(?)) WHERE id = ?`,
169 args: [JSON.stringify({ id: parseInt(fetchId), logs }), requestId],
170 });
171 return resp;
258 const requestId = req.headers.get("X-Request-ID");
259 if (requestId) {
260 const fetchId = req.headers.get("X-Fetch-ID");
261 req.headers.delete("X-Request-ID");
262 req.headers.delete("X-Fetch-ID");
263 return app.handleRequest(req, requestId, fetchId);
264 }
265 if (req.method === "GET") {
309 date: number;
310};
311type FetchInfo = {
312 id: number;
313 req: RequestObj;
319// outside of this function as it won't be available within the worker.
320const workerScript = () => {
321 const requests: FetchInfo[] = [];
322
323 let proxyUrl: string;
324 let requestId: number;
325 let fetchCount: number = 1;
326 let blobUrl: string;
327
332 .join("\n"));
333
334 globalThis.fetch = new Proxy(fetch, {
335 async apply(target, thisArg, args) {
336 const id = fetchCount++;
337 const ogUrl = args[0];
338 args[0] = proxyUrl;
340 args[1].headers = args[1].headers || {};
341 args[1].headers["X-Request-ID"] = requestId;
342 args[1].headers["X-Fetch-ID"] = id;
343 args[1].headers["X-Original-URL"] = ogUrl;
344 const req: RequestObj = {
349 };
350 delete req.headers["X-Request-ID"];
351 delete req.headers["X-Fetch-ID"];
352 delete req.headers["X-Original-URL"];
353 const stack = cleanStack((new Error()).stack).replaceAll(blobUrl, "./script.ts");

fetchPaginatedData2 file matches

@nbbaier•Updated 2 weeks ago

FetchBasic1 file match

@fredmoon•Updated 2 weeks ago