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=476&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 9807 results for "fetch"(1487ms)

project_updates_webhookApp.tsx5 matches

@shouser•Updated 2 months ago
8 const [notification, setNotification] = React.useState({ show: false, message: "", type: "" });
9
10 const fetchWebhooks = async () => {
11 setLoading(true);
12 // Commented out for now as per original code
13 // try {
14 // const response = await fetch("/getWebhooks");
15 // const data = await response.json();
16 // setWebhooks(data);
17 // } catch (error) {
18 // console.error("Failed to fetch webhooks", error);
19 // showNotification("Failed to load webhooks", "error");
20 // }
38
39 const handleWebhookSubmit = () => {
40 fetchWebhooks();
41 showNotification("Webhook registered successfully!");
42 };
43
44 React.useEffect(() => {
45 fetchWebhooks();
46 }, []);
47

project_updates_webhookWebhookForm.tsx1 match

@shouser•Updated 2 months ago
30
31 try {
32 const response = await fetch("/submit-webhook", {
33 method: "POST",
34 headers: { "Content-Type": "application/json" },

pdf2vector_svg_storemain.tsx3 matches

@dcm31•Updated 2 months ago
24 try {
25 const logEndpoint = "https://dcm31-pdf2vector-logger.web.val.run/";
26 await fetch(logEndpoint, {
27 method: "POST",
28 body: `SVG Store: ${info}`,
171 formData.append('svg', file);
172
173 const response = await fetch('', {
174 method: 'POST',
175 body: formData
211 if (confirm('Are you sure you want to delete this SVG?')) {
212 try {
213 const response = await fetch('/' + id, {
214 method: 'DELETE'
215 });

PDF2Vectorconverter4 matches

@dcm31•Updated 2 months ago
256
257 // Send to server
258 fetch('/errors', {
259 method: 'POST',
260 headers: { 'Content-Type': 'application/json' },
415 // Store SVG on server
416 try {
417 const response = await fetch('/store-svg', {
418 method: 'POST',
419 headers: { 'Content-Type': 'application/json' },
473
474 // Log detailed error to server
475 fetch('/errors', {
476 method: 'POST',
477 headers: { 'Content-Type': 'application/json' },
726});
727
728export default app.fetch;

twitterProfileUpdatedAlertmain.tsx2 matches

@socialdata•Updated 2 months ago
152 payload.embeds.push(summaryEmbed);
153
154 const response = await fetch(discordWebhookUrl, {
155 method: "POST",
156 headers: {
201 };
202
203 const response = await fetch(telegramApiUrl, {
204 method: "POST",
205 headers: {

twitterNewFollowingAlertmain.tsx2 matches

@socialdata•Updated 2 months ago
138 };
139
140 const response = await fetch(discordWebhookUrl, {
141 method: "POST",
142 headers: {
179 };
180
181 const response = await fetch(telegramApiUrl, {
182 method: "POST",
183 headers: {

wecrisprmain.tsx9 matches

@yawnxyz•Updated 2 months ago
11import { encode as base64Encode } from "https://deno.land/std@0.177.0/encoding/base64.ts";
12
13// Function to fetch and encode an external image
14async function fetchAndEncodeImage(url) {
15 try {
16 const response = await fetch(url);
17 if (!response.ok) {
18 throw new Error(`Failed to fetch image: ${response.status} ${response.statusText}`);
19 }
20 const arrayBuffer = await response.arrayBuffer();
22 return base64Encode(uint8Array);
23 } catch (error) {
24 console.error("Error fetching external image:", error);
25 throw error;
26 }
48 const userImageBase64 = base64Encode(uint8Array);
49
50 // Fetch and encode the scientist image
51 const scientistImageUrl = "https://pbs.twimg.com/media/GdMjZhubYAAM1Yf?format=jpg&name=4096x4096";
52 const scientistImageBase64 = await fetchAndEncodeImage(scientistImageUrl);
53
54 console.log("Processing images with Gemini 2.0 Flash Experimental...");
330 formData.append('prompt', this.prompt);
331
332 const response = await fetch('/edit-image', {
333 method: 'POST',
334 body: formData
505app.post("/edit-image", imageEditHandler);
506
507export default (typeof Deno !== "undefined" && Deno.env.get("valtown")) ? app.fetch : app;
508
509

loanWebApplicationmain.tsx1 match

@harsha_2506•Updated 2 months ago
236 ].filter(Boolean).join(" ");
237
238 const response = await fetch("/apply", {
239 method: "POST",
240 headers: { "Content-Type": "application/json" },

tradingSignalsAppmain.tsx6 matches

@HTKhan19•Updated 2 months ago
42 if (licenseKey === ADMIN_KEY) {
43 setViewMode('admin');
44 // Fetch existing signals for admin
45 try {
46 const signalsResponse = await fetch('/get-signals', {
47 method: 'POST',
48 headers: {
62 try {
63 // For public and VIP keys
64 const signalsResponse = await fetch('/get-signals', {
65 method: 'POST',
66 headers: {
97
98 try {
99 const response = await fetch('/add-signals', {
100 method: 'POST',
101 headers: {
112 setNewSignals('');
113 // Reload signals in admin view
114 const signalsResponse = await fetch('/get-signals', {
115 method: 'POST',
116 headers: {
134
135 try {
136 const response = await fetch('/clear-signals', {
137 method: 'POST',
138 headers: {

sendMessageToSlackmain.tsx2 matches

@kamalnrf•Updated 2 months ago
6
7export const sendMessage = async (body: Payload) => {
8 const res = await fetch(Deno.env.get("SLACK_WEBHOOK_URL"), {
9 method: "POST",
10 body: JSON.stringify(body),
20 };
21
22 const response = await fetch("https://slack.com/api/chat.postMessage", {
23 method: "POST",
24 headers: {

agentplex-deal-flow-email-fetch1 file match

@anandvc•Updated 1 day ago

proxyFetch2 file matches

@vidar•Updated 3 days ago