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%20%22Image%20title%22?q=fetch&page=14&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 8301 results for "fetch"(727ms)

fetchBinance1 file match

@oske•Updated 1 year ago

fetcher2 file matches

@u•Updated 1 year ago

fetchJSON1 file match

@dpetrouk•Updated 1 year ago

fetchestoomuch1 file match

@bitbloxhub•Updated 1 year ago

fetchTextWithEncoding1 file match

@stu43005•Updated 1 year ago

fetchRedditToken1 file match

@mschleske•Updated 1 year ago

proxyFetch2 file matches

@alp•Updated 1 year ago

fetchJSON2 file matches

@val•Updated 1 year ago

handleFetchTextResponse2 file matches

@devdoshi•Updated 1 year ago

proxyFetch52 file matches

@alp•Updated 1 year ago

glastonewsindex.ts10 matches

@bensomething•Updated 58 mins ago
1import process from "node:process";
2import { BskyAgent } from "npm:@atproto/api";
3import fetch from "npm:node-fetch";
4import * as cheerio from "npm:cheerio";
5
13const dateThreshold = new Date("2025-05-01");
14
15async function fetchWithRetry(url, options = {}, retries = 3, delay = 1000) {
16 for (let i = 0; i < retries; i++) {
17 try {
19 const timeoutId = setTimeout(() => controller.abort(), 10000);
20
21 const response = await fetch(url, {
22 ...options,
23 signal: controller.signal,
31
32 if (!response.ok) {
33 throw new Error(`Failed to fetch: ${response.statusText}`);
34 }
35 return response;
36 } catch (error) {
37 if (i < retries - 1) {
38 console.warn(`Fetch attempt ${i + 1} failed. Retrying...`);
39 await new Promise(resolve => setTimeout(resolve, delay));
40 } else {
45}
46
47async function fetchNews() {
48 const url = "https://glastonburyfestivals.co.uk/news/";
49 try {
50 const response = await fetchWithRetry(url);
51 const html = await response.text();
52 const $ = cheerio.load(html);
66 return news;
67 } catch (error) {
68 console.error("Error fetching news:", error);
69 throw error;
70 }
76 console.log("Logged in successfully.");
77
78 const newsItems = await fetchNews();
79 console.log(`Fetched ${newsItems.length} news items.`);
80
81 for (const news of newsItems) {

whatsapp-callbackindex.tsx5 matches

@yawnxyz•Updated 3 hours ago
35 console.log(`Sending to MCP for ${userIdentifier}:`, JSON.stringify(mcpPayload, null, 2));
36
37 const mcpApiResponse = await fetch("https://mcp.labspace.ai/chat", {
38 method: "POST",
39 headers: {
99 try {
100 console.log(`Attempting to send WhatsApp message to ${userPhoneNumber}`);
101 const sendMessageResponse = await fetch(
102 `https://graph.facebook.com/v18.0/${business_phone_number_id}/messages`,
103 {
135 console.log(`Attempting to mark message as read for ${userPhoneNumber} (message_id: ${message.id})`);
136 console.log("using API token:", WHATSAPP_GRAPH_API_TOKEN);
137 const markReadResponse = await fetch(
138 `https://graph.facebook.com/v18.0/${business_phone_number_id}/messages`,
139 {
220});
221
222// Export app.fetch for Val Town, otherwise export app
223export default (typeof Deno !== "undefined" && Deno.env.get("valtown"))
224 ? app.fetch
225 : app;