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/$2?q=fetch&page=1085&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 13190 results for "fetch"(7326ms)

ipqsScoreChangeAlertmain.tsx1 match

@nickgolden•Updated 10 months ago
18
19export async function checkIp() {
20 const result = await fetch(`https://ipqualityscore.com/api/json/ip/${ipqsApiKey}/${ipAddress}`);
21 const newData = await result.json();
22

surfboardDemoSchedule2main.tsx2 matches

@szymonator•Updated 10 months ago
34 // YOU MAY NOW RUN THE FILE.
35
36 const data = await fetch(
37 `https://api.stage.teamsurfboard.com/api/v1/schedule?start=${start.toISOString()}&end=${end.toISOString()}`,
38 {
54
55function Demo({ data }) {
56 if (!data) return <p>Failed to fetch</p>;
57
58 function processData(data) {

blobCommentsReactmain.tsx5 matches

@keenanzucker•Updated 10 months ago
10
11 useEffect(() => {
12 async function fetchSchedule() {
13 await fetch("/schedule")
14 .then(response => {
15 return response.json();
21 }
22
23 fetchSchedule();
24 }, []);
25
62 const tomorrow = new Date(today);
63 tomorrow.setDate(tomorrow.getDate() + 1);
64 const data = await fetch(
65 `https://api.stage.teamsurfboard.com/api/v1/schedule?start=${today.toISOString()}&end=${tomorrow.toISOString()}`,
66 {
76});
77
78export default app.fetch;

codeOnValTownmain.tsx3 matches

@andreterron•Updated 10 months ago
37
38/**
39 * @param handler Fetch handler
40 * @param val Define which val should open
41 */
42export function modifyFetchHandler(
43 handler: (req: Request) => Response | Promise<Response>,
44 { val, style }: { val?: ValRef; style?: string } = {},
52}
53
54export default modifyFetchHandler;

surfboardDemoSchedule2main.tsx2 matches

@keenanzucker•Updated 10 months ago
8 const tomorrow = new Date(today);
9 tomorrow.setDate(tomorrow.getDate() + 1);
10 const data = await fetch(
11 `https://api.stage.teamsurfboard.com/api/v1/schedule?start=${today.toISOString()}&end=${tomorrow.toISOString()}`,
12 {
36};
37function Schedule({ data }) {
38 if (!data) return <p>Failed to fetch</p>;
39
40 const [hours, setHours] = useState(10);

sourceOnGithubExamplemain.tsx1 match

@curtcox•Updated 10 months ago
28});
29
30export default app.fetch;

openaiproxymain.tsx2 matches

@mmrech•Updated 10 months ago
27 const authHeader = req.headers.get("Proxy-Authorization") || req.headers.get("Authorization");
28 const token = authHeader ? parseBearerString(authHeader) : undefined;
29 const meRes = await fetch(`${API_URL}/v1/me`, { headers: { Authorization: `Bearer ${token}` } });
30 if (!meRes.ok) {
31 return new Response("Unauthorized", { status: 401 });
62 });
63
64 const openAIRes = await fetch(url, {
65 method: req.method,
66 headers,

dependencyLicensesmain.tsx8 matches

@kylem•Updated 10 months ago
16}
17
18// Function to fetch package info from NPM registry
19async function fetchPackageInfo(packageName: string) {
20 const url = `https://registry.npmjs.org/${packageName}`;
21 const response = await fetch(url);
22 if (!response.ok) {
23 throw new Error(`Failed to fetch package info for ${packageName}`);
24 }
25 return response.json();
70async function checkPackageLicenses(packageJsonUrl: string): Promise<{ licenses: PackageLicense[]; repoName: string }> {
71 try {
72 const response = await fetch(packageJsonUrl);
73 if (!response.ok) {
74 throw new Error(`Failed to fetch package.json from ${packageJsonUrl}`);
75 }
76 const packageJson: PackageJson = await response.json();
83 for (const [name, version] of Object.entries(dependencies)) {
84 try {
85 const packageInfo = await fetchPackageInfo(name);
86 const license = extractLicenseInfo(packageInfo);
87 const repoUrl = extractGitHubRepoUrl(packageInfo);
165});
166
167export default app.fetch;

gitReleaseNotesmain.tsx11 matches

@kylem•Updated 10 months ago
16}
17
18// Function to fetch package info from NPM registry
19async function fetchPackageInfo(packageName: string) {
20 const url = `https://registry.npmjs.org/${packageName}`;
21 const response = await fetch(url);
22 if (!response.ok) {
23 throw new Error(`Failed to fetch package info for ${packageName}`);
24 }
25 return response.json();
45
46async function getGithubReleases(repo: string): Promise<GithubRelease[]> {
47 const response = await fetch(`https://api.github.com/repos/${repo}/releases`);
48 if (!response.ok) {
49 throw new Error(`Failed to fetch releases from ${repo}`);
50 }
51 return response.json();
76async function checkNpmUpdates(packageJsonUrl: string): Promise<string> {
77 try {
78 const response = await fetch(packageJsonUrl);
79 if (!response.ok) {
80 throw new Error(`Failed to fetch package.json from ${packageJsonUrl}`);
81 }
82 const packageJson: PackageJson = await response.json();
89 for (const [name, version] of Object.entries(dependencies)) {
90 try {
91 const packageInfo = await fetchPackageInfo(name);
92 const repoUrl = extractGitHubRepoUrl(packageInfo);
93 if (!repoUrl) {
114 for (const [name, version] of Object.entries(devDependencies)) {
115 try {
116 const packageInfo = await fetchPackageInfo(name);
117 const repoUrl = extractGitHubRepoUrl(packageInfo);
118 if (!repoUrl) {
178});
179
180export default app.fetch;

infiniteSVGGraphmain.tsx3 matches

@maxm•Updated 10 months ago
90 prompt = document.getElementById("svgInput").value;
91 }
92 let resp = await fetch("/remix/" + id, { method: "POST", body: JSON.stringify({ prompt }) });
93 const reader = resp.body.getReader();
94 const decoder = new TextDecoder();
139 const buttonContainer = button.closest(".heart-button-container");
140 const buttonRect = button.getBoundingClientRect();
141 fetch(`/${button.attributes["data-id"].value}/heart`, { method: "POST" });
142 for (let i = 0; i < 10; i++) {
143 const heart = document.createElement("div");
516 return c.text("OK");
517});
518export default app.fetch;

proxiedfetch1 file match

@jayden•Updated 14 hours ago

fetch-socials4 file matches

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