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=498&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 8234 results for "fetch"(1294ms)

getWeathermain.tsx2 matches

@lazynerdlab•Updated 5 months ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export async function getWeather(location: string): Promise<WeatherResponse> {
4 return fetchJSON(`https://wttr.in/${location}?format=j1`);
5}
6

cerebras_codermain.tsx1 match

@joyboy•Updated 5 months ago
23
24 try {
25 const response = await fetch("/", {
26 method: "POST",
27 body: JSON.stringify({ prompt, currentCode: code }),

exceptionalBlueMockingbirdmain.tsx4 matches

@elise_if•Updated 5 months ago
1import { email } from "https://esm.town/v/std/email?v=9";
2
3// Fetches a random joke:
4async function fetchRandomJoke() {
5 const response = await fetch(
6 "https://official-joke-api.appspot.com/random_joke",
7 );
9}
10
11const randomJoke = await fetchRandomJoke();
12const setup = randomJoke.setup;
13const punchline = randomJoke.punchline;

pageshotmain.tsx3 matches

@yawnxyz•Updated 5 months ago
64
65 console.log(">>>> Data", data)
66 const response = await fetch(pipeline_url, {
67 method: "POST",
68 headers: {
302 }
303
304 const response = await fetch('/pageshot', {
305 method: 'POST',
306 headers: {
559app.post("/pageshot", pageshotHandler);
560
561export default (typeof Deno !== "undefined" && Deno.env.get("valtown")) ? app.fetch : app;
562

deepLTranslatorAppmain.tsx2 matches

@sky_porie_fire443•Updated 5 months ago
34
35 try {
36 const response = await fetch("/translate", {
37 method: "POST",
38 headers: {
214
215 // 使用开放的翻译API作为备选方案
216 const translationResponse = await fetch(
217 `https://translate.googleapis.com/translate_a/single?client=gtx&sl=${source_lang === 'auto' ? 'auto' : source_lang}&tl=${target_lang}&dt=t&q=${encodeURIComponent(text)}`,
218 {

yc_findermain.tsx5 matches

@stevekrouse•Updated 5 months ago
62
63 useEffect(() => {
64 const fetchYCCompanies = async () => {
65 const storedCompanies = localStorage.getItem("ycCompanies");
66 if (storedCompanies) {
69 setDebugInfo(prevInfo => prevInfo + `\nLoaded ${companies.length} companies from localStorage`);
70 } else {
71 const response = await fetch("/companies.json");
72 const companies = await response.json();
73 setYcCompanies(companies);
74 localStorage.setItem("ycCompanies", JSON.stringify(companies));
75 setDebugInfo(prevInfo =>
76 prevInfo + `\nFetched ${companies.length} companies from server and stored in localStorage`
77 );
78 }
79 };
80 fetchYCCompanies();
81 }, []);
82
226
227export default async function server(request: Request): Promise<Response> {
228 const companies = await fetch("https://stevekrouse-yc_database.web.val.run").then(res => res.json());
229 const url = new URL(request.url);
230 if (url.pathname === "/companies.json") {

yc_databasemain.tsx1 match

@stevekrouse•Updated 5 months ago
7const BLOB_KEY = "yc-companies";
8// To reset the blob cache, uncomment the following line:
9// await blob.set(BLOB_KEY + ".csv", await (await fetch(GOOGLE_SHEET_CSV_URL)).blob());
10
11interface Row {

getWeathermain.tsx2 matches

@hercialvitalis21•Updated 5 months ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export async function getWeather(location: string): Promise<WeatherResponse> {
4 return fetchJSON(`https://wttr.in/${location}?format=j1`);
5}
6

weatherGPTmain.tsx1 match

@serkanokur•Updated 5 months ago
4let location = "munchen";
5let lang = "en";
6const weather = await fetch(
7 `https://wttr.in/${location}?lang=${lang}&format=j1`,
8).then(r => r.json());

scraper_templatemain.tsx1 match

@vawogbemi•Updated 5 months ago
9 const variable: string = await blob.getJSON(blobKey) ?? "";
10
11 const response = await fetch(scrapeURL);
12 const body = await response.text();
13 const $ = cheerio.load(body);

fetchPaginatedData2 file matches

@nbbaier•Updated 1 week ago

FetchBasic1 file match

@fredmoon•Updated 1 week ago