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%22Optional%20title%22?q=fetch&page=991&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 14112 results for "fetch"(7808ms)

captchamain.tsx1 match

@loading•Updated 4 months ago
136 async function submitScore() {
137 try {
138 const response = await fetch("/submit-highscore", {
139 method: "POST",
140 headers: {

sweetBlackHaremain.tsx1 match

@imnk•Updated 4 months ago
249
250 try {
251 const response = await fetch('/analyze', {
252 method: 'POST',
253 body: formData

blob_adminmain.tsx23 matches

@loading•Updated 4 months ago
234 const [isDragging, setIsDragging] = useState(false);
235
236 const fetchBlobs = useCallback(async () => {
237 setLoading(true);
238 try {
239 const response = await fetch(`/api/blobs?prefix=${encodeKey(searchPrefix)}&limit=${limit}`);
240 const data = await response.json();
241 setBlobs(data);
242 } catch (error) {
243 console.error("Error fetching blobs:", error);
244 } finally {
245 setLoading(false);
248
249 useEffect(() => {
250 fetchBlobs();
251 }, [fetchBlobs]);
252
253 const handleSearch = (e) => {
264 setBlobContentLoading(true);
265 try {
266 const response = await fetch(`/api/blob?key=${encodeKey(clickedBlob.key)}`);
267 const content = await response.text();
268 setSelectedBlob({ ...clickedBlob, key: decodeKey(clickedBlob.key) });
269 setEditContent(content);
270 } catch (error) {
271 console.error("Error fetching blob content:", error);
272 } finally {
273 setBlobContentLoading(false);
278 const handleSave = async () => {
279 try {
280 await fetch(`/api/blob?key=${encodeKey(selectedBlob.key)}`, {
281 method: "PUT",
282 body: editContent,
290 const handleDelete = async (key) => {
291 try {
292 await fetch(`/api/blob?key=${encodeKey(key)}`, { method: "DELETE" });
293 setBlobs(blobs.filter(b => b.key !== key));
294 if (selectedBlob && selectedBlob.key === key) {
307 const key = `${searchPrefix}${file.name}`;
308 formData.append("key", encodeKey(key));
309 await fetch("/api/blob", { method: "POST", body: formData });
310 const newBlob = { key, size: file.size, lastModified: new Date().toISOString() };
311 setBlobs([newBlob, ...blobs]);
315 }
316 }
317 fetchBlobs();
318 };
319
329 try {
330 const fullKey = `${searchPrefix}${key}`;
331 await fetch(`/api/blob?key=${encodeKey(fullKey)}`, {
332 method: "PUT",
333 body: "",
344 const handleDownload = async (key) => {
345 try {
346 const response = await fetch(`/api/blob?key=${encodeKey(key)}`);
347 const blob = await response.blob();
348 const url = window.URL.createObjectURL(blob);
363 if (newKey && newKey !== oldKey) {
364 try {
365 const response = await fetch(`/api/blob?key=${encodeKey(oldKey)}`);
366 const content = await response.blob();
367 await fetch(`/api/blob?key=${encodeKey(newKey)}`, {
368 method: "PUT",
369 body: content,
370 });
371 await fetch(`/api/blob?key=${encodeKey(oldKey)}`, { method: "DELETE" });
372 setBlobs(blobs.map(b => b.key === oldKey ? { ...b, key: newKey } : b));
373 if (selectedBlob && selectedBlob.key === oldKey) {
383 const newKey = `__public/${key}`;
384 try {
385 const response = await fetch(`/api/blob?key=${encodeKey(key)}`);
386 const content = await response.blob();
387 await fetch(`/api/blob?key=${encodeKey(newKey)}`, {
388 method: "PUT",
389 body: content,
390 });
391 await fetch(`/api/blob?key=${encodeKey(key)}`, { method: "DELETE" });
392 setBlobs(blobs.map(b => b.key === key ? { ...b, key: newKey } : b));
393 if (selectedBlob && selectedBlob.key === key) {
402 const newKey = key.slice(9); // Remove "__public/" prefix
403 try {
404 const response = await fetch(`/api/blob?key=${encodeKey(key)}`);
405 const content = await response.blob();
406 await fetch(`/api/blob?key=${encodeKey(newKey)}`, {
407 method: "PUT",
408 body: content,
409 });
410 await fetch(`/api/blob?key=${encodeKey(key)}`, { method: "DELETE" });
411 setBlobs(blobs.map(b => b.key === key ? { ...b, key: newKey } : b));
412 if (selectedBlob && selectedBlob.key === key) {
826});
827
828export default lastlogin((request: Request) => app.fetch(request));

cerebras_codermain.tsx1 match

@telvideo•Updated 4 months ago
182
183 try {
184 const response = await fetch("/", {
185 method: "POST",
186 body: JSON.stringify({

tasks_test1main.tsx13 matches

@arfan•Updated 4 months ago
162
163 React.useEffect(() => {
164 fetchTasks();
165 }, []);
166
167 const fetchTasks = async () => {
168 const response = await fetch('/api/tasks');
169 const fetchedTasks = await response.json();
170 setTasks(fetchedTasks);
171 };
172
188 if (newTask.text.trim() && newTask.dueDate) {
189 try {
190 const response = await fetch('/api/tasks', {
191 method: 'POST',
192 headers: { 'Content-Type': 'application/json' },
196 setNewTask({ text: '', done: false, dueDate: DEFAULT_DATE });
197 setIsAddTaskModalOpen(false);
198 fetchTasks();
199 }
200 } catch (error) {
206 const handleDeleteTask = async (taskId) => {
207 try {
208 const response = await fetch(`/api/tasks/${taskId}`, { method: 'DELETE' });
209 if (response.ok) {
210 fetchTasks();
211 }
212 } catch (error) {
224 if (taskToEdit.text.trim() && taskToEdit.dueDate) {
225 try {
226 const response = await fetch(`/api/tasks/${taskToEdit.id}`, {
227 method: 'PUT',
228 headers: { 'Content-Type': 'application/json' },
232 setIsEditTaskModalOpen(false);
233 setTaskToEdit(null);
234 fetchTasks();
235 }
236 } catch (error) {
242 const handleToggleTaskCompletion = async (taskId, done) => {
243 try {
244 const response = await fetch(`/api/tasks/${taskId}`, {
245 method: 'PATCH',
246 headers: { 'Content-Type': 'application/json' },
248 });
249 if (response.ok) {
250 fetchTasks();
251 }
252 } catch (error) {

helpfulTealTapirmain.tsx1 match

@vishu44•Updated 4 months ago
182
183 try {
184 const response = await fetch("/", {
185 method: "POST",
186 body: JSON.stringify({

vigilantAmaranthDragonflymain.tsx1 match

@vishu44•Updated 4 months ago
182
183 try {
184 const response = await fetch("/", {
185 method: "POST",
186 body: JSON.stringify({

protectiveWhiteToadmain.tsx1 match

@vishu44•Updated 4 months ago
182
183 try {
184 const response = await fetch("/", {
185 method: "POST",
186 body: JSON.stringify({

philosophicalSapphirePtarmiganmain.tsx1 match

@vishu44•Updated 4 months ago
182
183 try {
184 const response = await fetch("/", {
185 method: "POST",
186 body: JSON.stringify({

loyalOrangeCanidaemain.tsx1 match

@vishu44•Updated 4 months ago
187
188 try {
189 const response = await fetch("/", {
190 method: "POST",
191 body: JSON.stringify({

FetchBasic2 file matches

@ther•Updated 1 week ago

GithubPRFetcher

@andybak•Updated 1 week ago