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=17&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 14089 results for "fetch"(1297ms)

CheckExamplemain.tsx2 matches

@wolfUpdated 2 days ago
1let resp = await fetch("https://lsp-dev.val.town/auth", {
2 method: "POST",
3 headers: {
7});
8const cookie = resp.headers.get("set-cookie");
9resp = await fetch("https://lsp-dev.val.town/lsp/check", {
10 method: "POST",
11 headers: {

untitled-2430main.tsx1 match

@Rinku123Updated 2 days ago
123. In JavaScript:
13 - Add an event listener to the “Get Quote” button.
14 - Send an HTTP request to a Python back end to fetch a new random quote each time the button is clicked.
15 - Update the quote box with the returned text.
16

html2svgmain.tsx1 match

@gUpdated 2 days ago
221app.get("/main.js", serve(js, "text/javascript"));
222
223export default app.fetch;

OptimismTrackerindex.ts1 match

@dcm31Updated 2 days ago
34});
35
36export default app.fetch;

FarcasterSpacesSpace.tsx7 matches

@moeUpdated 2 days ago
7
8import { Button, Input, Section, ShareButton, Sheet } from '../components/ui.tsx'
9import { fetchUsersById } from '../util/neynar.ts'
10import { supabase, fetchSpace } from '../util/supabase.ts'
11
12import {
44 const { id } = useParams()
45
46 const { data: space, isLoading } = useQuery({ queryKey: ['space', id], queryFn: () => fetchSpace(id) })
47
48 const [calling, setCalling] = useState(false)
139
140 const queryFn = () =>
141 fetch(`/api/channels`)
142 .then((r) => r.json())
143 .then((r) => r?.data?.channels?.find((c) => c.channel_name == channel))
146
147 const join = async () => {
148 const response = await fetch(`/api/token?channel=${channel}&uid=${uid}`).then((r) => r.json())
149 console.log('response', response)
150 setToken(response.token)
408 if (!uid) return null
409 if (uid > 2_000_000) return null
410 return await fetchUsersById(`${uid}`).then((users) => users?.[0])
411}
412
439
440 useEffect(() => {
441 fetchSpace(id).then(setSpace)
442
443 const changes = supabase

FarcasterSpacesindex.tsx4 matches

@moeUpdated 2 days ago
7import { embedMetadata, handleFarcasterEndpoints, name } from './farcaster.ts'
8import { handleImageEndpoints } from './image.tsx'
9import { fetchNeynarGet } from './neynar.ts'
10
11const app = new Hono()
28 const url = new URL(c.req.url)
29 const path = url.searchParams.get('path')
30 const response = await fetchNeynarGet(path)
31 return c.json(response)
32})
73})
74
75// HTTP vals expect an exported "fetch handler"
76// This is how you "run the server" in Val Town with Hono
77export default app.fetch
78

FarcasterSpacesimage.tsx6 matches

@moeUpdated 2 days ago
5import satori from 'npm:satori'
6
7import { fetchSpace } from '../frontend/util/supabase.ts'
8import { fetchUsersById } from './neynar.ts'
9
10export function handleImageEndpoints(app: Hono) {
38
39export async function spaceImage(channel: string) {
40 const space = await fetchSpace(channel)
41 if (!space) return await homeImage()
42
43 const users = await fetchUsersById([space.created_by, ...space.hosts, ...space.speakers].join(','))
44
45 const hostFids = [space.created_by, ...space.hosts]
126 const fontPromises = fontsConfig.map(async (font) => {
127 const fontUrl = 'https://cdn.jsdelivr.net/npm/@tamagui/font-inter@1.108.3/otf/' + font.fontFile
128 const fontArrayBuf = await fetch(fontUrl).then((res) => res.arrayBuffer())
129 return { name: font.name, data: fontArrayBuf, weight: font.weight }
130 })
137 // const api = `https://cdnjs.cloudflare.com/ajax/libs/twemoji/14.0.2/svg/${code.toLowerCase()}.svg`
138 const api = `https://cdn.jsdelivr.net/gh/shuding/fluentui-emoji-unicode/assets/${code.toLowerCase()}_color.svg`
139 return fetch(api).then((r) => r.text())
140}
141

FarcasterSpacesHome.tsx2 matches

@moeUpdated 2 days ago
7
8import { Button, Input, Section, ShareButton } from '../components/ui.tsx'
9import { fetchUsersById } from '../util/neynar.ts'
10import { supabase } from '../util/supabase.ts'
11
39function Spaces() {
40 const queryFn = async () => {
41 const agoraChannels = await fetch(`/api/channels`)
42 .then((r) => r.json())
43 .then((r) => r?.data?.channels)

FarcasterSpacesfarcaster-notifications.ts2 matches

@moeUpdated 2 days ago
44 const { data, error } = await supabase.from(table).select()
45 if (error) {
46 console.error('🔔 sendNotificationToAllUsers: error fetching users', error)
47 return
48 }
60
61async function sendNotification(notificationDetails: any, payload: any) {
62 return await fetch(notificationDetails.url, {
63 method: 'POST',
64 headers: { 'Content-Type': 'application/json' },

FarcasterSpacessupabase.ts1 match

@moeUpdated 2 days ago
22}
23
24export const fetchSpace = async (id: string) => {
25 const { data, error } = await supabase.from('spaces').select().eq('id', id).single()
26 // console.log('🗄️ space', data, error)

FetchBasic2 file matches

@therUpdated 1 week ago

GithubPRFetcher

@andybakUpdated 1 week ago