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/image-url.jpg?q=fetch&page=1199&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 13344 results for "fetch"(1183ms)

get_current_weathermain.tsx2 matches

@cosmo•Updated 1 year ago
1export async function getCurrentWeather(latitude = 0, longitude = 0) {
2 const pointsResponse = await fetch(`https://api.weather.gov/points/${latitude},${longitude}`),
3 { properties: { forecastHourly } } = await pointsResponse.json(),
4 forecastResponse = await fetch(forecastHourly),
5 { properties: { periods } } = await forecastResponse.json();
6

beaconREADME.md1 match

@visnup•Updated 1 year ago
3Reacquaint myself with how modern browsers deal with cross-origin cookies. Specifically, how aggressive does Safari limit them nowadays? (Answer: very aggressive, to the point of just disabling them.)
4
5This endpoint simply tries to assign a 28-day-from-now-expiring device cookie when requested, providing all of the obligatory-in-2024 cookie flags and headers to allow cross-origin support. You can request it from another origin in different browsers and inspect if cookies are sent back or not (either via `sendBeacon` or `fetch(..., {credentials: "include"})` or in the iframe browser preview below).
6
7Chrome and Firefox subsequently send back a persistent cookie; Safari does not. Edge probably does what Chrome does. I dunno what Braze does.

ninja_keysmain.tsx1 match

@pomdtr•Updated 1 year ago
55});
56
57export default app.fetch;

encodingAndConsolidationmain.tsx1 match

@petermillspaugh•Updated 1 year ago
67 fillBlank: FILL_BLANK,
68 quiz: QUIZ,
69 fetchHtml: (email: string, lesson: number) =>
70 generateLessonHtml({
71 email,

fepsmain.tsx1 match

@vladimyr•Updated 1 year ago
7});
8
9export default app.fetch;

honoTanaEndpointmain.tsx1 match

@nbbaier•Updated 1 year ago
32 });
33
34 return app.fetch(req);
35};

createValmain.tsx2 matches

@andreterron•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export const createVal = async ({ code, token, name, privacy }: {
7 privacy?: "public" | "unlisted" | "private";
8}) => {
9 return fetchJSON("https://api.val.town/v1/vals", {
10 method: "post",
11 bearer: token,

longest_valmain.tsx2 matches

@andreterron•Updated 1 year ago
1import { paginateAPI } from "https://esm.town/v/andreterron/paginateAPI";
2import { API_URL } from "https://esm.town/v/std/API_URL?v=5";
3import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
4
5let max: { lines: number; name: string } | undefined;
10 },
11};
12const me = await fetchJSON(
13 `${API_URL}/v1/me`,
14 opts,

draftReadmemain.tsx3 matches

@nbbaier•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch?v=4";
2import OpenAI, { type ClientOptions } from "npm:openai";
3
25async function getVal(username: string, valName: string) {
26 try {
27 const res = await fetch(`https://api.val.town/v1/alias/${username}/${valName}`, {
28 method: "GET",
29 headers: {
67async function updateReadme(id: string, readme: string) {
68 try {
69 const res = await fetch(`https://api.val.town/v1/vals/${id}`, {
70 method: "PUT",
71 headers: {

readmeGPTmain.tsx3 matches

@nbbaier•Updated 1 year ago
1import { type WriterOptions } from "https://esm.town/v/nbbaier/WriterOptions";
2import { fetch } from "https://esm.town/v/std/fetch?v=4";
3import OpenAI, { type ClientOptions } from "npm:openai";
4
32 private async getVal(username: string, valName: string) {
33 try {
34 const res = await fetch(`https://api.val.town/v1/alias/${username}/${valName}`, {
35 method: "GET",
36 headers: {
72 private async updateReadme(id: string, readme: string) {
73 try {
74 const res = await fetch(`https://api.val.town/v1/vals/${id}`, {
75 method: "PUT",
76 headers: {

GithubPRFetcher

@andybak•Updated 1 day ago

proxiedfetch1 file match

@jayden•Updated 2 days ago