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=576&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 7881 results for "fetch"(1499ms)

steampipeQuerymain.tsx1 match

@pomdtr•Updated 10 months ago
1const query = "select title, url from hackernews_top limit 10;";
2
3const resp = await fetch(`https://steampipe.pomdtr.me/query/${encodeURIComponent(query)}?output=json`, {
4 headers: {
5 Authorization: "Bearer " + Deno.env.get("SMALLWEB_TOKEN"),

query_aian_lar_map_servermain.tsx1 match

@parkerziegler•Updated 10 months ago
3 `https://biamaps.geoplatform.gov/server/rest/services/DivLTR/BIA_AIAN_National_LAR/MapServer/0/query?where=1%3D1&text=&objectIds=&time=&timeRelation=esriTimeRelationOverlaps&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&distance=&units=esriSRUnit_Foot&relationParam=&outFields=&returnGeometry=true&returnTrueCurves=false&maxAllowableOffset=&geometryPrecision=&outSR=&havingClause=&returnIdsOnly=false&returnCountOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&gdbVersion=&historicMoment=&returnDistinctValues=false&resultOffset=&resultRecordCount=&returnExtentOnly=false&sqlFormat=none&datumTransformation=&parameterValues=&rangeValues=&quantizationParameters=&featureEncoding=esriDefault&f=geojson`;
4
5fetch(endpoint)
6 .then((res) => res.json())
7 .then((data) => {

TextTransformermain.tsx2 matches

@chet•Updated 10 months ago
37
38 try {
39 const response = await fetch('${url}', {
40 method: 'POST',
41 headers: {
52 textarea.value = data;
53 } catch (error) {
54 console.error('Error during fetch:', error);
55 alert('There was an error processing your request.');
56 }

HtmlFormattermain.tsx2 matches

@chet•Updated 10 months ago
39
40 try {
41 const response = await fetch('${url}', {
42 method: 'POST',
43 headers: {
54 textarea.value = data;
55 } catch (error) {
56 console.error('Error during fetch:', error);
57 alert('There was an error processing your request.');
58 }

multirouteHonomain.tsx1 match

@iamseeley•Updated 10 months ago
122app.notFound((c) => c.render(<NotFoundPage />));
123
124export default app.fetch;

blobbyFacemain.tsx15 matches

@stevekrouse•Updated 10 months ago
2import { blobby } from "https://esm.town/v/yawnxyz/blobby";
3import { fileTypeFromBuffer } from 'npm:file-type';
4import { modifyFetchHandler } from "https://esm.town/v/andreterron/codeOnValTown?v=50";
5import { passwordAuth } from "https://esm.town/v/pomdtr/password_auth?v=74";
6
66
67
68// Endpoint to fetch blob by key
69app.get("/blob/:key", async (c) => {
70 const key = c.req.param('key');
193 this.blobs[key] = {isLoading: true};
194
195 const response = await fetch('/blob/' + key);
196 const contentType = response.headers.get('Content-Type');
197 blob.type = contentType || 'text/plain';
223 let blob = this.blobs[key];
224 try {
225 const response = await fetch('/create/' + key, {
226 method: 'POST',
227 headers: {
247
248 // Send a delete request to the server
249 const response = await fetch('/delete/' + key, { method: 'GET' });
250
251 // Check the response status
313
314 try {
315 const response = await fetch('/upload/' + key, {
316 method: 'POST',
317 body: formData,
338
339 try {
340 const response = await fetch('/uploadUrl' + '?key=' + key + '&url=' + url);
341
342 if (!response.ok) {
361 if (!this.newKeyName) return;
362 try {
363 const response = await fetch('/rename?key='+key+'&newKey='+this.newKeyName);
364 if (!response.ok) {
365 throw new Error('Failed to rename blob');
526 async loadBlob() {
527 this.isLoading = true;
528 const response = await fetch('/blob/' + this.key);
529 const contentType = response.headers.get('Content-Type');
530 this.blobType = contentType || 'text/plain';
550 async updateCreate() {
551 try {
552 const response = await fetch('/create/' + this.key, {
553 method: 'POST',
554 headers: {
573
574 try {
575 const response = await fetch('/upload/' + this.key, {
576 method: 'POST',
577 body: formData,
593 if (this.uploadUrl) {
594 try {
595 const response = await fetch('/uploadUrl?key=' + this.key + '&url=' + this.uploadUrl);
596
597 if (!response.ok) {
610 if (!this.newKeyName) return;
611 try {
612 const response = await fetch('/rename?key=' + this.key + '&newKey=' + this.newKeyName);
613 if (!response.ok) {
614 throw new Error('Failed to rename blob');
707
708
709// export default app.fetch;
710export default passwordAuth(app.fetch, {
711 // password: "123", // Deno.env.get("AUTH_TEST"),
712});

isMyWebsiteDownmain.tsx2 matches

@psimyn•Updated 10 months ago
10 let reason: string;
11 try {
12 const res = await fetch(URL, { redirect: "follow" });
13 if (res.status !== 200) {
14 reason = `(status code: ${res.status})`;
16 }
17 } catch (e) {
18 reason = `couldn't fetch: ${e}`;
19 ok = false;
20 }

isMyWebsiteDownmain.tsx2 matches

@tdehart•Updated 10 months ago
8 let reason: string;
9 try {
10 const res = await fetch(URL, { redirect: "follow" });
11 if (res.status !== 200) {
12 reason = `(status code: ${res.status})`;
14 }
15 } catch (e) {
16 reason = `couldn't fetch: ${e}`;
17 ok = false;
18 }

violetBuzzardmain.tsx2 matches

@pomdtr•Updated 10 months ago
122};
123
124export type FetchAction = {
125 type: "run";
126 command: string;
139};
140
141export type Command = OpenAction | CopyAction | FetchAction | PushAction;
142export type View = List | Detail | Form;
143

counterTownmain.tsx2 matches

@stevekrouse•Updated 10 months ago
1/** @jsxImportSource npm:hono@3/jsx */
2import { sqlite } from "https://esm.town/v/std/sqlite?v=6";
3import { reloadOnSaveFetchMiddleware } from "https://esm.town/v/stevekrouse/reloadOnSave";
4import { Hono } from "npm:hono";
5
50
51const app = new Hono();
52export default reloadOnSaveFetchMiddleware(counterTownMiddleware(app.fetch));
53app.get("/", async (c) => {
54 return c.html(

fetchPaginatedData2 file matches

@nbbaier•Updated 1 week ago

FetchBasic1 file match

@fredmoon•Updated 1 week ago