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/?q=fetch&page=358&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 8061 results for "fetch"(656ms)

selarAppmain.tsx7 matches

@stevekrouse•Updated 2 months ago
14
15 useEffect(() => {
16 fetchLeads();
17 }, []);
18
19 const fetchLeads = async () => {
20 const response = await fetch("/leads");
21 const data = await response.json();
22 setLeads(data);
25 const handleSubmit = async (e) => {
26 e.preventDefault();
27 const response = await fetch("/leads", {
28 method: "POST",
29 headers: { "Content-Type": "application/json" },
32
33 if (response.ok) {
34 fetchLeads();
35 setNewLead({
36 name: "",
44
45 const updateLeadStatus = async (id, newStatus) => {
46 const response = await fetch(`/leads/${id}`, {
47 method: "PATCH",
48 headers: { "Content-Type": "application/json" },
51
52 if (response.ok) {
53 fetchLeads();
54 }
55 };

admirableWhiteBirdmain.tsx1 match

@Tanveer•Updated 2 months ago
38
39 try {
40 const response = await fetch("/chat", {
41 method: "POST",
42 headers: { "Content-Type": "application/json" },

caringCoralMoosemain.tsx1 match

@Tanveer•Updated 2 months ago
38
39 try {
40 const response = await fetch("/chat", {
41 method: "POST",
42 headers: { "Content-Type": "application/json" },

attendancemain.tsx2 matches

@rayyan•Updated 2 months ago
5const app = new Hono();
6
7export default app.fetch;
8
9const parseAttendance = async (facultyNo: string) => {
10 const html = await fetch(
11 `https://ctengg.amu.ac.in/web/table.php?id=${facultyNo}`,
12 ).then((r) => r.text());

pickball_round_robinmain.tsx1 match

@stevekrouse•Updated 2 months ago
11 const handleSubmit = async (e) => {
12 e.preventDefault();
13 const response = await fetch("/generate", {
14 method: "POST",
15 headers: { "Content-Type": "application/json" },

cerebrasTemplatemain.tsx1 match

@daisuke•Updated 2 months ago
20
21 try {
22 const response = await fetch("/chat", {
23 method: "POST",
24 headers: { "Content-Type": "application/json" },

cookieFetchmain.tsx5 matches

@gwoods22•Updated 2 months ago
2
3/**
4 * Send a fetch request while maintaining cookies
5 *
6 * @param {string | URL} url - The URL to fetch
7 * @param {RequestInit} initialOptions - fetch config options (HTTP method, headers) Pass {} if not needed
8 * @param {string} blobKey - key where cookies are stored in blob
9 */
10export const cookieFetch = async (url: string | URL, initialOptions: RequestInit, blobKey: string) => {
11 try {
12 let cookies: string = await blob.getJSON(blobKey) ?? "";
19 };
20 }
21 const resp = await fetch(url, options);
22
23 const newCookies = resp.headers.get("set-cookie") ?? "";

orbiterHealthmonitor3 matches

@stevedylandev•Updated 2 months ago
10async function notifySlack(message: string) {
11 try {
12 await fetch(WEBHOOK_URL, {
13 method: "POST",
14 headers: {
29 const start = performance.now();
30 try {
31 const res = await fetch(url);
32 end = performance.now();
33 status = res.status;
40 } catch (e) {
41 end = performance.now();
42 reason = `couldn't fetch: ${e}`;
43 ok = false;
44 console.log(`Website down (${url}): ${reason} (${end - start}ms)`);

setmain.tsx2 matches

@std•Updated 2 months ago
1import { API_URL } from "https://esm.town/v/std/API_URL";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
3import process from "node:process";
4
5export async function set(key: string, value: any) {
6 let resp = await fetch(
7 `${API_URL}/v1/vals`,
8 {

HowManyDaysUntilmain.tsx1 match

@curtcox•Updated 2 months ago
16 if (excluded) params.append(day.toLowerCase(), 'false');
17 });
18 const response = await fetch(`?${params.toString()}`);
19 const data = await response.json();
20 setResult(data.days);

fetchPaginatedData2 file matches

@nbbaier•Updated 1 week ago

FetchBasic1 file match

@fredmoon•Updated 1 week ago