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=12&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"(697ms)

fetchProxy1 file match

@ridge•Updated 1 year ago

fetchBlob1 file match

@crsven•Updated 1 year ago

fetchJavascriptWeeklyIssues2 file matches

@Timmy•Updated 1 year ago

fetchRssParser2 file matches

@shellphon•Updated 1 year ago

fetchXML1 file match

@_•Updated 1 year ago

fetchGiphy1 file match

@simply_say_m•Updated 1 year ago

proxyFetch102 file matches

@alp•Updated 1 year ago

fetchImageAsBase642 file matches

@liamdanielduffy•Updated 1 year ago

fetchAndParseXML2 file matches

@mgruel•Updated 1 year ago

fetchJSON1 file match

@U9G•Updated 1 year ago

glastonewsindex.ts10 matches

@bensomething•Updated 56 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";
5import fs from "node:fs";
31}
32
33async function fetchWithRetry(url, options = {}, retries = 3, delay = 1000) {
34 for (let i = 0; i < retries; i++) {
35 try {
37 const timeoutId = setTimeout(() => controller.abort(), 10000);
38
39 const response = await fetch(url, {
40 ...options,
41 signal: controller.signal,
49
50 if (!response.ok) {
51 throw new Error(`Failed to fetch: ${response.statusText}`);
52 }
53 return response;
54 } catch (error) {
55 if (i < retries - 1) {
56 console.warn(`Fetch attempt ${i + 1} failed. Retrying...`);
57 await new Promise(resolve => setTimeout(resolve, delay));
58 } else {
63}
64
65async function fetchNews() {
66 const url = "https://glastonburyfestivals.co.uk/news/";
67 try {
68 const response = await fetchWithRetry(url);
69 const html = await response.text();
70 const $ = cheerio.load(html);
84 return news;
85 } catch (error) {
86 console.error("Error fetching news:", error);
87 throw error;
88 }
95
96 const postedNewsTitles = loadPostedNews();
97 const newsItems = await fetchNews();
98 console.log(`Fetched ${newsItems.length} news items.`);
99
100 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;