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?q=fetch&page=799&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 13014 results for "fetch"(1497ms)

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: {

AntiSpamV2main.tsx13 matches

@wahobd•Updated 2 months ago
310
311 try {
312 const response = await fetch('/save-credentials', {
313 method: 'POST',
314 headers: {
468
469 try {
470 const response = await fetch('/validate-credentials-access', {
471 method: 'POST',
472 headers: {
480 if (result.success) {
481 setAuthenticated(true);
482 fetchCredentials();
483 saveAccessPassword(password);
484 } else {
493 const saveAccessPassword = async (password: string) => {
494 try {
495 const response = await fetch('/save-access-password', {
496 method: 'POST',
497 headers: {
509 };
510
511 const fetchCredentials = async () => {
512 try {
513 const response = await fetch('/get-credentials');
514 if (!response.ok) {
515 throw new Error('Failed to fetch credentials');
516 }
517 const data = await response.json();
546 const handleDelete = async (index: number) => {
547 try {
548 const response = await fetch('/delete-credential', {
549 method: 'POST',
550 headers: {
559
560 // Refresh the credentials list
561 fetchCredentials();
562 } catch (error) {
563 console.error('Error:', error);
569 if (confirm(`Are you sure you want to delete all ${type} credentials?`)) {
570 try {
571 const response = await fetch('/delete-all-credentials', {
572 method: 'POST',
573 headers: {
582
583 // Refresh the credentials list
584 fetchCredentials();
585 } catch (error) {
586 console.error('Error:', error);
929 });
930 } catch (error) {
931 console.error('Error fetching credentials:', error);
932 return new Response(JSON.stringify({error: 'Failed to fetch credentials'}), {
933 status: 500,
934 headers: { 'Content-Type': 'application/json' }

PDF2Vectorlog-api.js1 match

@dcm31•Updated 2 months ago
195});
196
197export default app.fetch;
198

PDF2Vectorlogger.js4 matches

@dcm31•Updated 2 months ago
110 async saveLogs() {
111 try {
112 if (typeof window !== 'undefined' && window?.fetch) {
113 const response = await fetch('/api/store-logs', {
114 method: 'POST',
115 headers: { 'Content-Type': 'application/json' },
132 async loadLogs() {
133 try {
134 if (typeof window !== 'undefined' && window?.fetch) {
135 const response = await fetch(`/api/load-logs?key=${this.storeKey}`);
136 if (response.ok) {
137 const data = await response.json();

PDF2Vectordebug1 match

@dcm31•Updated 2 months ago
122 // Log to server
123 try {
124 await fetch('./logger', {
125 method: 'POST',
126 headers: { 'Content-Type': 'text/plain' },

PDF2Vectorlogger1 match

@dcm31•Updated 2 months ago
61 function clearLogs() {
62 if (confirm('Are you sure you want to clear all logs?')) {
63 fetch('./clear')
64 .then(response => {
65 if (response.ok) {

fetch-socials4 file matches

@welson•Updated 2 days ago
fetch and archive my social posts

fetchRssForSubcurrent2 file matches

@ashryanio•Updated 3 days ago