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/$%7Bsuccess?q=fetch&page=646&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 9164 results for "fetch"(1626ms)

verySalmonEmumain.tsx1 match

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

sqliteExplorerAppmain.tsx4 matches

@teamgroove•Updated 8 months ago
1/** @jsxImportSource https://esm.sh/hono@latest/jsx **/
2
3import { modifyFetchHandler } from "https://esm.town/v/andreterron/codeOnValTown?v=50";
4import { iframeHandler } from "https://esm.town/v/nbbaier/iframeHandler";
5import { resetStyle } from "https://esm.town/v/nbbaier/resetStyle";
16import { verifyToken } from "https://esm.town/v/pomdtr/verifyToken";
17import { ResultSet, sqlite } from "https://esm.town/v/std/sqlite";
18import { reloadOnSaveFetchMiddleware } from "https://esm.town/v/stevekrouse/reloadOnSave";
19import { Hono } from "npm:hono";
20import type { FC } from "npm:hono/jsx";
175});
176
177export const handler = app.fetch;
178export default iframeHandler(modifyFetchHandler(passwordAuth(handler, { verifyPassword: verifyToken })));

aiTextEditormain.tsx1 match

@sharanbabu•Updated 8 months ago
131
132 try {
133 const response = await fetch("/process", {
134 method: "POST",
135 headers: { "Content-Type": "application/json" },

htmlkitREADME.md1 match

@yawnxyz•Updated 8 months ago
1This module provides functions to convert HTML to various formats such as Markdown, Pug, and Turndown.
2It also includes utilities to fetch HTML from a URL, extract metadata, and clean HTML by removing unwanted selectors.
3Dependencies include Cheerio for HTML parsing, JSDOM for DOM manipulation, and Turndown for converting HTML to Markdown.
4

slackScoutmain.tsx8 matches

@ewinney•Updated 8 months ago
20 for (const topic of KEYWORDS) {
21 const results = await Promise.allSettled([
22 fetchHackerNewsResults(topic),
23 fetchTwitterResults(topic),
24 fetchRedditResults(topic),
25 ]);
26
49}
50
51// Fetch Hacker news, Twitter, and Reddit results
52async function fetchHackerNewsResults(topic: string): Promise<Website[]> {
53 return hackerNewsSearch({
54 query: topic,
58}
59
60async function fetchTwitterResults(topic: string): Promise<Website[]> {
61 return twitterSearch({
62 query: topic,
67}
68
69async function fetchRedditResults(topic: string): Promise<Website[]> {
70 return redditSearch({ query: topic });
71}
84 }
85
86 const response = await fetch(slackWebhookUrl, {
87 method: "POST",
88 headers: { "Content-Type": "application/json" },

smsjournalertextrelaymain.tsx2 matches

@cephalization•Updated 8 months ago
54// Helper function to send SMS using TextBelt API
55async function sendSMS(phone: string, message: string) {
56 const response = await fetch("https://textbelt.com/text", {
57 method: "POST",
58 headers: { "Content-Type": "application/json" },
107
108export default async function server(request: Request): Promise<Response> {
109 const quotaResponse = await fetch(
110 `https://textbelt.com/quota/${textbeltKey}`,
111 )

blob_adminmain.tsx2 matches

@davisshaver•Updated 8 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";
137});
138
139export default modifyFetchHandler(passwordAuth(app.fetch));

finalScrapermain.tsx6 matches

@rochambeau314•Updated 8 months ago
1// This val creates a form to input a Zillow or Craigslist link, determines the link type,
2// calls the appropriate scraping API, and renders the results in a table.
3// It uses React for the UI, fetch for API calls, and basic string manipulation for link validation.
4
5/** @jsxImportSource https://esm.sh/react */
20
21 try {
22 const response = await fetch("/scrape", {
23 method: "POST",
24 headers: { "Content-Type": "application/json" },
27
28 if (!response.ok) {
29 throw new Error("Failed to fetch data");
30 }
31
33 setResults(data);
34 } catch (err) {
35 setError("An error occurred while fetching the data.");
36 } finally {
37 setIsLoading(false);
106
107 try {
108 const scrapeResponse = await fetch(`${scrapingEndpoint}${encodeURIComponent(link)}`);
109 if (!scrapeResponse.ok) {
110 throw new Error("Failed to scrape data");
113
114 // Calculate transit time
115 const transitResponse = await fetch(`https://rochambeau314-calculatetransitapi.web.val.run?address=${encodeURIComponent(scrapeResult.address)}`);
116 if (!transitResponse.ok) {
117 throw new Error("Failed to calculate transit time");

resyBookSlotmain.tsx2 matches

@vtdocs•Updated 8 months ago
1import { fetch } from "https://esm.town/v/std/fetch";
2import { resyPublicAPIKey } from "https://esm.town/v/vtdocs/resyPublicAPIKey";
3import { sleep } from "https://esm.town/v/vtdocs/sleep";
18 while (true) {
19 try {
20 const bookRes = await fetch(`https://api.resy.com/3/book`, {
21 method: "POST",
22 headers: {

resyGetSlotBookingTokenmain.tsx2 matches

@vtdocs•Updated 8 months ago
1import { fetch } from "https://esm.town/v/std/fetch";
2import { resyPublicAPIKey } from "https://esm.town/v/vtdocs/resyPublicAPIKey";
3
15 party_size: partySize.toString(),
16 };
17 const detailsRes = await fetch(
18 `https://api.resy.com/3/details?${new URLSearchParams(detailsParams)}`,
19 {

proxyFetch2 file matches

@vidar•Updated 19 hours ago

TAC_FetchBasic2 file matches

@A7_OMC•Updated 1 day ago