18});
19
20export default app.fetch;
113 // Get video info using YouTube oEmbed API
114 const infoUrl = `https://www.youtube.com/oembed?url=https://www.youtube.com/watch?v=${videoId}&format=json`;
115 const infoResponse = await fetch(infoUrl);
116
117 if (!infoResponse.ok) {
118 throw new Error('Failed to fetch video information');
119 }
120
129 formData.append('q_auto', '0');
130
131 const y2mateResponse = await fetch(y2mateUrl, {
132 method: 'POST',
133 body: formData,
375 resultContainer.classList.add('hidden');
376
377 const response = await fetch('/api/download', {
378 method: 'POST',
379 headers: {
18
191. The user enters a video URL and clicks "Get Info"
202. The application fetches video information from the backend
213. The user selects a quality and clicks "Download"
224. The application requests the download from the backend
21 let follows: any[] = [];
22 let cursor: string | undefined = undefined;
23 let pagesFetched = 0;
24
25 let seenDids = new Set();
54 // Take time between each page to avoid hammering bluesky too much
55 await new Promise(resolve => setTimeout(resolve, 100));
56 pagesFetched++;
57 console.log(`${pagesFetched} PAGES FETCHED`);
58 }
59
60 console.log(`${pagesFetched} PAGES FETCHED`);
61 console.log(`${follows.length} PROFILES FETCHED`);
62
63 type R = {
34
35export async function packImage(id: string) {
36 const pack = await fetchStarterPack(id)
37 // if (!pack) return await homeImage()
38
39 // const users = await fetchUsersById([space.created_by, ...space.hosts, ...space.speakers].join(','))
40
41 // const hostFids = [space.created_by, ...space.hosts]
121 const fontPromises = fontsConfig.map(async (font) => {
122 const fontUrl = 'https://cdn.jsdelivr.net/npm/@tamagui/font-inter@1.108.3/otf/' + font.fontFile
123 const fontArrayBuf = await fetch(fontUrl).then((res) => res.arrayBuffer())
124 return { name: font.name, data: fontArrayBuf, weight: font.weight }
125 })
132 // const api = `https://cdnjs.cloudflare.com/ajax/libs/twemoji/14.0.2/svg/${code.toLowerCase()}.svg`
133 const api = `https://cdn.jsdelivr.net/gh/shuding/fluentui-emoji-unicode/assets/${code.toLowerCase()}_color.svg`
134 return fetch(api).then((r) => r.text())
135}
136
145//////////
146
147export async function fetchWarpcastGet(path: string) {
148 return await fetch(`https://client.warpcast.com/${path}`).then(r => r.json())
149}
150
151export async function fetchStarterPack(id: string | undefined) {
152 if (!id) return null
153 const response = await fetchWarpcastGet(`v2/starter-pack?id=${id}`).then((r) => r?.result?.starterPack)
154 return response
155}
210 try {
211 // Download the image
212 const imageResponse = await fetch(imageUrl);
213
214 if (!imageResponse.ok) {
215 return new Response(`Failed to fetch image: ${imageResponse.statusText}`, { status: 400 });
216 }
217
246 try {
247 // Download the image
248 const imageResponse = await fetch(imageUrl);
249
250 if (!imageResponse.ok) {
251 return {
252 success: false,
253 error: `Failed to fetch image: ${imageResponse.statusText}`
254 };
255 }
1export default async function() {
2 const res = await fetch(
3 "https://theavenuechurch.churchcenter.com/api/v1/registrations/opportunities?include=registration_forms,location",
4 );
1# Framer Fetch: Basic
2
3A basic example of an API endpoint to use with Framer Fetch.
21 let follows: any[] = [];
22 let cursor: string | undefined = undefined;
23 let pagesFetched = 0;
24
25 let seenDids = new Set();
54 // Take time between each page to avoid hammering bluesky too much
55 await new Promise(resolve => setTimeout(resolve, 100));
56 pagesFetched++;
57 console.log(`${pagesFetched} PAGES FETCHED`);
58 }
59
60 console.log(`${pagesFetched} PAGES FETCHED`);
61 console.log(`${follows.length} PROFILES FETCHED`);
62
63 type R = {
31```javascript
32// Example API call
33const response = await fetch('YOUR_VAL_TOWN_URL', {
34 method: 'POST',
35 headers: {