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=99&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 8515 results for "fetch"(1192ms)

MiniAppStarter1App.tsx5 matches

@charmaine•Updated 2 weeks ago
8import { FarcasterMiniApp } from "./components/FarcasterMiniApp.tsx";
9import { Button, Section } from "./components/ui.tsx";
10import { fetchNeynarGet } from "./util/neynar.ts";
11
12export function App() {
67
68function Database() {
69 const queryFn = () => fetch("/api/counter/get").then((r) => r.json());
70 const { data, refetch } = useQuery({ queryKey: ["counter"], queryFn });
71 return (
72 <Section className="flex flex-col items-start gap-3 m-5">
73 {/* <h2 className="font-semibold">Database Example</h2> */}
74 <div className="">Counter value: {data}</div>
75 <Button variant="outline" onClick={() => fetch("/api/counter/increment").then(refetch)}>
76 Increment
77 </Button>
82function Neynar() {
83 useEffect(() => {
84 fetchNeynarGet("user/by_username?username=moe").then(console.log).catch(console.error);
85 }, []);
86

Notion_GCal_Syncnotion.ts1 match

@charmaine•Updated 2 weeks ago
261
262 // Create the page in Notion
263 const response = await fetch("https://api.notion.com/v1/pages", {
264 method: "POST",
265 headers: {

Notion_GCal_Sync_1userInfo.ts4 matches

@charmaine•Updated 2 weeks ago
37 : searchName;
38
39 const response = await fetch(
40 `https://serpapi.com/search.json?engine=google&q=${encodeURIComponent(searchQuery)}&api_key=${serpApiKey}`
41 );
127 return null;
128 } catch (error) {
129 console.error("Error fetching data from SERP API:", error);
130 return null;
131 }
147
148 if (serpApiKey) {
149 const response = await fetch(
150 `https://serpapi.com/search.json?engine=google&q=${encodeURIComponent(domain)}&api_key=${serpApiKey}`
151 );
185 };
186 } catch (error) {
187 console.error("Error fetching company data:", error);
188 return null;
189 }

Notion_GCal_Sync_1notion.ts1 match

@charmaine•Updated 2 weeks ago
261
262 // Create the page in Notion
263 const response = await fetch("https://api.notion.com/v1/pages", {
264 method: "POST",
265 headers: {

Notion_GCal_Sync_1index.ts2 matches

@charmaine•Updated 2 weeks ago
1import { fetchTodaysMeetings } from "./googleCalendar.ts";
2import { createMeetingPage } from "./notion.ts";
3import { getUserInfo } from "./userInfo.ts";
21 try {
22 // Get today's meetings from Google Calendar
23 const meetings = await fetchTodaysMeetings();
24 console.log(`Found ${meetings.length} total meetings for today`);
25

Notion_GCal_Sync_1googleCalendar.ts8 matches

@charmaine•Updated 2 weeks ago
1/**
2 * Google Calendar integration to fetch meetings and identify user meetings
3 */
4
45 }
46
47 const tokenResponse = await fetch("https://oauth2.googleapis.com/token", {
48 method: "POST",
49 headers: {
67
68/**
69 * Fetch today's calendar events from Google Calendar
70 */
71async function fetchCalendarEvents(): Promise<GoogleCalendarEvent[]> {
72 const accessToken = await getAccessToken();
73
83 const url = `https://www.googleapis.com/calendar/v3/calendars/${encodeURIComponent(calendarId)}/events?timeMin=${encodeURIComponent(timeMin)}&timeMax=${encodeURIComponent(timeMax)}&singleEvents=true&orderBy=startTime`;
84
85 const response = await fetch(url, {
86 headers: {
87 Authorization: `Bearer ${accessToken}`,
90
91 if (!response.ok) {
92 throw new Error(`Failed to fetch calendar events: ${await response.text()}`);
93 }
94
127 * Process calendar events to identify user meetings
128 */
129export async function fetchTodaysMeetings(): Promise<Meeting[]> {
130 const events = await fetchCalendarEvents();
131 const teamDomain = Deno.env.get("TEAM_DOMAIN") || "val.town";
132 console.log(`Using team domain: ${teamDomain}`);

pondiversefetchCreations0 matches

@iliazeus•Updated 2 weeks ago
1import { blob } from "https://esm.town/v/std/blob";
2import { sqlite } from "https://esm.town/v/stevekrouse/sqlite";
3import { TABLE_NAME } from "./updateTable";
4
5export default async function(req: Request): Promise<Response> {

simpleAnalyticsmain.tsx1 match

@orjpap•Updated 2 weeks ago
32 let func = `(async () => {
33 try {
34 await fetch(import.meta.url, {
35 method: "POST",
36 headers: {

BP_Trackermain.tsx6 matches

@anna_kagai•Updated 2 weeks ago
145
146 useEffect(() => {
147 fetchReadings();
148 }, []);
149
150 const fetchReadings = async () => {
151 try {
152 const response = await fetch('/readings');
153 const data = await response.json();
154 setReadings(data);
155 } catch (err) {
156 setError('Failed to fetch readings');
157 }
158 };
167
168 try {
169 const response = await fetch('/log', {
170 method: 'POST',
171 headers: { 'Content-Type': 'application/json' },
183 setPulse('');
184 setError('');
185 fetchReadings();
186 }
187 } catch (err) {

templateTwitterAlertmain.tsx1 match

@Enliven•Updated 2 weeks ago
19 : Math.floor((Date.now() - 2 * 24 * 60 * 60 * 1000) / 1000);
20
21 // Fetch and log tweets
22 const response = await socialDataSearch(`${query} since_time:${timeFrame}`);
23 console.log("Response from socialDataSearch:", response);

fetchPaginatedData2 file matches

@nbbaier•Updated 2 weeks ago

FetchBasic1 file match

@fredmoon•Updated 2 weeks ago