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=174&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 10361 results for "fetch"(1324ms)

acme-customsindex.tsx4 matches

@yawnxyz•Updated 1 week ago
68
69 async createWebCall(params) {
70 const response = await fetch(\`\${this.baseUrl}/call/web\`, {
71 method: 'POST',
72 headers: {
1180 if (!this.transcriptText || this.transcriptText.startsWith('Awaiting connection')) return;
1181 try {
1182 const res = await fetch("/extract-data", {
1183 method: "POST",
1184 headers: { "Content-Type": "application/json" },
1277});
1278
1279// Export app.fetch for Val Town, otherwise export app
1280export default (typeof Deno !== "undefined" && Deno.env.get("valtown"))
1281 ? app.fetch
1282 : app;

cerebras_coderindex.ts1 match

@BELLOYARON•Updated 1 week ago
181
182 try {
183 const response = await fetch("/", {
184 method: "POST",
185 body: JSON.stringify({

untitled-7712index.ts2 matches

@mayree•Updated 1 week ago
35 let html = await readFile("/frontend/index.html", import.meta.url);
36
37 // Fetch initial data
38 const jobs = await getJobs();
39 const messages = await getMessages(20); // Get last 20 messages
119
120// Export the Hono app
121export default app.fetch;

untitled-7712index.js17 matches

@mayree•Updated 1 week ago
49 renderMessages();
50 } else {
51 fetchJobs();
52 fetchMessages();
53 }
54
78
79 // Set up polling for new messages
80 setInterval(fetchMessages, 5000);
81}
82
83// API calls
84async function fetchJobs() {
85 try {
86 const response = await fetch('/api/jobs');
87 if (!response.ok) throw new Error('Failed to fetch jobs');
88
89 state.jobs = await response.json();
90 renderJobs();
91 } catch (error) {
92 console.error('Error fetching jobs:', error);
93 elements.jobsContainer.innerHTML = '<p class="text-red-500">Error loading jobs. Please try again.</p>';
94 }
95}
96
97async function fetchMessages(limit = 50) {
98 try {
99 const response = await fetch(`/api/messages?limit=${limit}`);
100 if (!response.ok) throw new Error('Failed to fetch messages');
101
102 const newMessages = await response.json();
108 }
109 } catch (error) {
110 console.error('Error fetching messages:', error);
111 if (elements.chatMessages.children.length === 0) {
112 elements.chatMessages.innerHTML = '<p class="text-red-500">Error loading messages. Please try again.</p>';
117async function createUser(username) {
118 try {
119 const response = await fetch('/api/users', {
120 method: 'POST',
121 headers: { 'Content-Type': 'application/json' },
136async function createJob(jobData) {
137 try {
138 const response = await fetch('/api/jobs', {
139 method: 'POST',
140 headers: { 'Content-Type': 'application/json' },
155async function sendMessage(content) {
156 try {
157 const response = await fetch('/api/messages', {
158 method: 'POST',
159 headers: { 'Content-Type': 'application/json' },
169 }
170
171 // Fetch latest messages after sending
172 fetchMessages();
173 return await response.json();
174 } catch (error) {
225 elements.jobForm.reset();
226 toggleModal(elements.jobModal, false);
227 fetchJobs();
228
229 // Announce the new job in chat

pass-genpassword-generator.ts5 matches

@dooooogie•Updated 1 week ago
1export default async function (req: Request) {
2 // Fetch a password from dinopass.com on the server side to avoid CORS issues
3 let dinoPassword = "";
4 try {
5 const response = await fetch('https://www.dinopass.com/password/simple');
6 dinoPassword = await response.text();
7 } catch (error) {
8 console.error('Error fetching from dinopass:', error);
9 dinoPassword = "quietbat76"; // Fallback example
10 }
245 button.innerHTML = '<span>Generating...</span>';
246
247 // Fetch from our own endpoint to avoid CORS issues
248 const response = await fetch(window.location.href);
249 const html = await response.text();
250

pass-genREADME.md1 match

@dooooogie•Updated 1 week ago
14## How It Works
15
161. When the "Generate Password" button is clicked, the app fetches a simple password from dinopass.com
172. It extracts two whole words from the response
183. It formats them as Word99Word! (with capitalized first letters)

untitled-2444index.ts2 matches

@all•Updated 1 week ago
163 } else {
164 // Use the server proxy
165 const response = await fetch("/api/process", {
166 method: "POST",
167 body: formData
727
728 try {
729 const response = await fetch("/api/detect-type", {
730 method: "POST",
731 headers: {

Afolabismain.tsx4 matches

@vawogbemi•Updated 1 week ago
110}
111
112const useAuthenticatedFetch = () => {
113 const { getToken } = useAuth();
114
116 const token = await getToken();
117
118 return await fetch(`https://www.thegluechat.com${endpoint}`, {
119 method: "POST",
120 body: JSON.stringify(data),
813 setIsLoading(true);
814 // Reverse geocode the coordinates to get an address
815 const response = await fetch(
816 `https://maps.googleapis.com/maps/api/geocode/json?latlng=${position.coords.latitude},${position.coords.longitude}&key=AIzaSyAOtUMb5jLTjTVM7iKzIx2SJ3HgMKNcM7U`,
817 );
1230});
1231
1232export default app.fetch;

createindex.ts1 match

@charmaine•Updated 1 week ago
65
66// This is the entry point for HTTP vals
67export default app.fetch;

createContactDetail.tsx10 matches

@charmaine•Updated 1 week ago
22 const [isAddingInteraction, setIsAddingInteraction] = useState(false);
23
24 // Fetch interactions for this contact
25 const fetchInteractions = async () => {
26 if (!contact.id) return;
27
30
31 try {
32 const response = await fetch(`/api/contacts/${contact.id}/interactions`);
33 const result = await response.json();
34
35 if (!result.success) {
36 throw new Error(result.error || "Failed to fetch interactions");
37 }
38
40 } catch (err) {
41 setError(err instanceof Error ? err.message : "An unknown error occurred");
42 console.error("Error fetching interactions:", err);
43 } finally {
44 setIsLoading(false);
48 // Load interactions when contact changes
49 useEffect(() => {
50 fetchInteractions();
51 }, [contact.id]);
52
54 const handleAddInteraction = async (interaction: Interaction) => {
55 try {
56 const response = await fetch("/api/interactions", {
57 method: "POST",
58 headers: { "Content-Type": "application/json" },
69 }
70
71 fetchInteractions();
72 setIsAddingInteraction(false);
73 onContactUpdated();
83
84 try {
85 const response = await fetch(`/api/interactions/${id}`, {
86 method: "DELETE"
87 });
93 }
94
95 fetchInteractions();
96 onContactUpdated();
97 } catch (err) {

fetchTechNews

@josiasaurel•Updated 4 hours ago

agentplex-deal-flow-email-fetch1 file match

@anandvc•Updated 5 days ago