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=2&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 11151 results for "fetch"(1470ms)

WordWarsindex.ts1 match

@potluck•Updated 5 hours ago
171});
172
173export default app.fetch;

personalShopperkrogerAuth.ts7 matches

@bgschiller•Updated 5 hours ago
57 const credentials = btoa(`${this.clientId}:${this.clientSecret}`);
58
59 const response = await fetch(`${KROGER_BASE_URL}/v1/connect/oauth2/token`, {
60 method: "POST",
61 headers: {
84 const credentials = btoa(`${this.clientId}:${this.clientSecret}`);
85
86 const response = await fetch(`${KROGER_BASE_URL}/v1/connect/oauth2/token`, {
87 method: "POST",
88 headers: {
108 */
109 async getUserProfile(accessToken: string): Promise<KrogerProfileResponse> {
110 const response = await fetch(`${KROGER_BASE_URL}/v1/identity/profile`, {
111 headers: {
112 Authorization: `Bearer ${accessToken}`,
117 if (!response.ok) {
118 const errorText = await response.text();
119 throw new Error(`Profile fetch failed: ${response.status} ${errorText}`);
120 }
121
179 });
180
181 const response = await fetch(
182 `${KROGER_BASE_URL}/v1/locations?${params.toString()}`,
183 {
206 locationId: string
207 ): Promise<KrogerLocationResponse> {
208 const response = await fetch(
209 `${KROGER_BASE_URL}/v1/locations/${locationId}`,
210 {
218 if (!response.ok) {
219 const errorText = await response.text();
220 throw new Error(`Location fetch failed: ${response.status} ${errorText}`);
221 }
222

Presentationsindex.ts1 match

@wolf•Updated 5 hours ago
76});
77
78export default app.fetch;

PresentationsAddPresentation.tsx1 match

@wolf•Updated 5 hours ago
37
38 try {
39 const response = await fetch('/api/presentations', {
40 method: 'POST',
41 headers: {

PresentationsPresentationItem.tsx2 matches

@wolf•Updated 5 hours ago
44
45 try {
46 const response = await fetch(`/api/presentations/${presentation.id}`, {
47 method: 'PUT',
48 headers: {
69 const confirmRemove = async () => {
70 try {
71 const response = await fetch(`/api/presentations/${presentation.id}`, {
72 method: 'DELETE',
73 });

Presentationsindex.tsx7 matches

@wolf•Updated 6 hours ago
6import type { Presentation } from "../shared/types.ts";
7
8// Get initial data from server-side injection or fetch from API
9const getInitialData = (): Presentation[] => {
10 if (typeof window !== 'undefined' && (window as any).__INITIAL_DATA__) {
45 upcomingPresentationDay.setUTCMilliseconds(0);
46
47 const fetchPresentations = async () => {
48 setLoading(true);
49 try {
50 const response = await fetch('/api/presentations');
51 const data = await response.json();
52 setPresentations(data);
53 } catch (error) {
54 console.error('Error fetching presentations:', error);
55 } finally {
56 setLoading(false);
59
60 useEffect(() => {
61 // Only fetch if we don't have initial data
62 if (presentations.length === 0) {
63 fetchPresentations();
64 }
65 }, []);
70 presentations={presentations}
71 firstThursday={firstThursday}
72 onRefresh={fetchPresentations}
73 loading={loading}
74 />

embedmain.ts1 match

@g•Updated 6 hours ago
94app.get("/main.js", serve(js, "text/javascript"));
95
96export default app.fetch;

nyc-mapindex.ts1 match

@thomasinch•Updated 6 hours ago
23});
24
25export default app.fetch;

townie-testingserveFile.md1 match

@chadparker•Updated 7 hours ago
71
72 // Inject initial data to avoid extra round-trips
73 const initialData = await fetchInitialData();
74 const dataScript = `<script>
75 window.__INITIAL_DATA__ = ${JSON.stringify(initialData)};

pineconenew-file-6541.tsx14 matches

@mees•Updated 7 hours ago
45
46 // Create a quick thread for parsing
47 const threadResponse = await fetch("https://api.openai.com/v1/threads", {
48 method: "POST",
49 headers: {
58
59 // Add the query
60 await fetch(`https://api.openai.com/v1/threads/${thread.id}/messages`, {
61 method: "POST",
62 headers: {
72
73 // Run the parser assistant
74 const runResponse = await fetch(`https://api.openai.com/v1/threads/${thread.id}/runs`, {
75 method: "POST",
76 headers: {
99 await new Promise(resolve => setTimeout(resolve, 500));
100
101 const statusResponse = await fetch(
102 `https://api.openai.com/v1/threads/${thread.id}/runs/${run.id}`,
103 {
113
114 // Get the response
115 const messagesResponse = await fetch(
116 `https://api.openai.com/v1/threads/${thread.id}/messages?order=desc&limit=1`,
117 {
591 }
592
593 // Create or retrieve thread using raw fetch with v2 headers
594 let thread;
595 if (threadId) {
596 const threadResponse = await fetch(`https://api.openai.com/v1/threads/${threadId}`, {
597 headers: baseHeaders,
598 });
602 thread = await threadResponse.json();
603 } else {
604 const threadResponse = await fetch("https://api.openai.com/v1/threads", {
605 method: "POST",
606 headers: baseHeaders,
627
628 // Add message to thread with v2 headers
629 const messageResponse = await fetch(`https://api.openai.com/v1/threads/${thread.id}/messages`, {
630 method: "POST",
631 headers: baseHeaders,
641
642 // Run the assistant with v2 headers
643 const runResponse = await fetch(`https://api.openai.com/v1/threads/${thread.id}/runs`, {
644 method: "POST",
645 headers: baseHeaders,
862 };
863
864 // Poll for completion using raw fetch with v2 headers
865 let runStatus = run;
866 let allMediaDisplays = [];
875 await new Promise(resolve => setTimeout(resolve, 2000));
876
877 const statusResponse = await fetch(
878 `https://api.openai.com/v1/threads/${thread.id}/runs/${run.id}`,
879 { headers: baseHeaders },
904
905 // Submit tool outputs with v2 headers
906 const toolOutputResponse = await fetch(
907 `https://api.openai.com/v1/threads/${thread.id}/runs/${run.id}/submit_tool_outputs`,
908 {
928
929 // Get the assistant's response with v2 headers
930 const messagesResponse = await fetch(
931 `https://api.openai.com/v1/threads/${thread.id}/messages?order=desc&limit=20`,
932 { headers: baseHeaders },

fetch-socials

@welson•Updated 1 hour ago
fetch and archive my social posts

fetchRssForSubcurrent2 file matches

@ashryanio•Updated 4 hours ago