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=20&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 11675 results for "fetch"(1461ms)

Syphrose1990useProject.tsx5 matches

@Syphrose1990•Updated 3 hours ago
9 const [error, setError] = useState(null);
10
11 const fetchData = async () => {
12 try {
13 const projectEndpoint = new URL(PROJECT_ENDPOINT, window.location.origin);
17 if (branchId) filesEndpoint.searchParams.append("branchId", branchId);
18
19 const { project } = await fetch(projectEndpoint).then((res) =>
20 res.json()
21 );
22 const { files } = await fetch(filesEndpoint).then((res) => res.json());
23
24 setData({ project, files });
34 useEffect(() => {
35 if (!projectId) return;
36 fetchData();
37 }, [projectId, branchId]);
38
39 return { data, loading, error, refetch: fetchData };
40}
41

Syphrose1990useProjects.tsx4 matches

@Syphrose1990•Updated 3 hours ago
8 const [error, setError] = useState(null);
9
10 const fetchData = async () => {
11 try {
12 const res = await fetch(ENDPOINT);
13 const data = await res.json();
14 if (!res.ok) {
32
33 useEffect(() => {
34 fetchData();
35 }, []);
36
37 return { data, loading, error, refetch: fetchData };
38}
39

Syphrose1990useCreateProject.tsx1 match

@Syphrose1990•Updated 3 hours ago
19 setError(null);
20 try {
21 const res = await fetch(ENDPOINT, {
22 method: "POST",
23 headers: {

Syphrose1990useCreateBranch.tsx1 match

@Syphrose1990•Updated 3 hours ago
12 setData(null);
13 setError(null);
14 const res = await fetch(ENDPOINT, {
15 method: "POST",
16 body: JSON.stringify({

Syphrose1990useBranches.tsx4 matches

@Syphrose1990•Updated 3 hours ago
7 const [loading, setLoading] = useState(true);
8
9 const fetchData = async () => {
10 const endpoint = new URL(ENDPOINT, window.location.origin);
11 endpoint.searchParams.append("projectId", projectId);
12
13 const res = await fetch(endpoint)
14 .then(res => res.json());
15 setData(res.branches);
19 useEffect(() => {
20 if (!projectId) return;
21 fetchData();
22 }, [projectId]);
23
24 return { data, loading, refetch: fetchData };
25}

Syphrose1990TODOs.md1 match

@Syphrose1990•Updated 3 hours ago
47<!--
48
49- [x] refetch project data on create/etc
50- [x] Loading favicon
51- [x] Ensure main branch is default selected

Syphrose1990text-editor.ts1 match

@Syphrose1990•Updated 3 hours ago
166 let type_: "file" | "http" | "script";
167 if (path.includes("backend/index.ts")) type_ = "http";
168 if (file_text?.includes("export default app.fetch")) type_ = "http";
169 if ([".ts", ".tsx", ".js", ".jsx"].some(ext => path.endsWith(ext))) {
170 type_ = "script";

Syphrose1990system_prompt.txt3 matches

@Syphrose1990•Updated 3 hours ago
216
217 // Inject data to avoid extra round-trips
218 const initialData = await fetchInitialData();
219 const dataScript = `<script>
220 window.__INITIAL_DATA__ = ${JSON.stringify(initialData)};
263
2645. **API Design:**
265 - `fetch` handler is the entry point for HTTP vals
266 - Run the Hono app with `export default app.fetch // This is the entry point for HTTP vals`
267
2686. **Hono Peculiarities:**

Syphrose1990styles.css9 matches

@Syphrose1990•Updated 3 hours ago
1/** fetch tool styles */
2.fetch-result {
3 display: flex;
4 flex-direction: column;
6}
7
8.fetch-header {
9 display: flex;
10 justify-content: space-between;
45}
46
47.fetch-section {
48 margin-top: var(--space-2);
49}
50
51.fetch-section h4 {
52 margin-bottom: var(--space-1);
53 font-size: var(--font-size-5);
54}
55
56.fetch-headers, .fetch-body {
57 font-size: var(--font-size-6);
58 background-color: var(--slate-50);
63}
64
65.fetch-error {
66 color: var(--red);
67}
68
69.fetch-error h4 {
70 margin-bottom: var(--space-1);
71 font-size: var(--font-size-5);
72}
73
74.fetch-error pre {
75 font-size: var(--font-size-6);
76 background-color: var(--red-light);

Syphrose1990send-message.ts5 matches

@Syphrose1990•Updated 3 hours ago
13 startTrackingUsage,
14} from "../database/queries.tsx";
15import { makeChangeValTypeTool, makeFetchTool, makeTextEditorTool } from "../tools/index.ts";
16import fileWithLinesNumbers from "../utils/fileWithLinesNumbers.ts";
17
156 }
157
158 // If there are selected files, fetch their content and add them to the messages
159 if (selectedFiles && selectedFiles.length > 0) {
160 const vt = new ValTown({ bearerToken });
176 fileContents += `## File: ${filePath}\n\`\`\`\n${fileWithLinesNumbers(content)}\n\`\`\`\n\n`;
177 } catch (error) {
178 console.error(`Error fetching file ${filePath}:`, error);
179 fileContents += `## File: ${filePath}\nError: Could not fetch file content\n\n`;
180 }
181 }
220 // think: thinkTool,
221 change_val_type: makeChangeValTypeTool({ bearerToken, project, branch_id: branchId }),
222 fetch: makeFetchTool({ bearerToken, project, branch_id: branchId }),
223 },
224 maxSteps: 20,

fetch-socials4 file matches

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

fetchRssForSubcurrent2 file matches

@ashryanio•Updated 1 day ago