gptMemoryManagermain.tsx1 match
458});
459460return app.fetch(req);
461};
youtubeEndpointmain.tsx10 matches
2import { YouTube } from 'https://deno.land/x/youtube@v0.3.0/mod.ts';
34export async function fetchVideoDetails(req) {
5const url = new URL(req.url);
6let yturl = url.searchParams.get("yturl") || "";
2930try {
31let response = await fetch(apiUrl);
32let data = await response.json();
33if (!data.items || data.items.length === 0) {
84const categoryId = item.snippet.categoryId;
85apiUrl = `https://www.googleapis.com/youtube/v3/videoCategories?part=snippet&id=${categoryId}&key=${apiKey}`;
86response = await fetch(apiUrl);
87data = await response.json();
88const category = data.items && data.items.length > 0 ? data.items[0].snippet.title : 'N/A';
94break;
95case 'transcript':
96async function fetchcaptions(videoId) {
97const WATCH_URL = `https://www.youtube.com/watch?v=${videoId}`;
9899try {
100const response = await fetch(WATCH_URL);
101const html = await response.text();
102const jsonMatch = html.match(/"captions":({.*?}), "videoDetails"/);
110111const captionsUrl = captionsJson.captionTracks[0].baseUrl;
112const captionsResponse = await fetch(captionsUrl);
113const captionsText = await captionsResponse.text();
114return captionsText;
115} catch (error) {
116console.error('Failed to fetch Youtube captions:', error);
117throw error;
118}
119}
120121fetchcaptions(videoId).then(captions => {
122return new Response(captions);
123}).catch(error => {
124console.error('Error fetching captions:', error)
125});
126130return new Response(responseContent);
131} catch (error) {
132console.error("Error fetching video details:", error);
133throw error;
134}
checkTensorArtWebStatusmain.tsx3 matches
1import { fetch } from "https://esm.town/v/std/fetch";
2import process from "node:process";
34export async function checkTensorArtWebStatus() {
5async function sendLarkMessage(message) {
6return fetch(process.env.larkTensorRobotUrl, {
7method: "POST",
8headers: {
29const responses = await Promise.all(
30urls.map((url) => {
31return fetch(url);
32}),
33);
untitled_ivoryFishmain.tsx4 matches
1import { hamptonzachary29@gmail.com} from "https://esm.town/v/std/email?v=9";
23// Fetches a random joke.
4async function fetchRandomJoke() {
5const response = await fetch(
6"https://official-joke-api.appspot.com/random_joke",
7);
9}
1011const randomJoke = await fetchRandomJoke();
12const setup = randomJoke.setup;
13const punchline = randomJoke.punchline;
isMyWebsiteDownmain.tsx3 matches
1import { email } from "https://esm.town/v/std/email?v=9";
2import { fetch } from "https://esm.town/v/std/fetch";
34export const isMyWebsiteDown = async () => {
11try {
12const start = Date.now();
13const res = await fetch(URL);
14const millisecondsSpent = Date.now() - start;
15const jsonData = await res.json();
25}
26catch (e) {
27reason = `couldn't fetch: ${e}`;
28ok = false;
29}
clerk_hono_pocmain.tsx1 match
111}
112});
113export default app.fetch;
11app.get("/edit/:blob", async (c) => c.html(`TODO: Edit ${c.req.param("blob")}`));
12app.get("/delete/:blob", async (c) => c.html(`TODO: Delete ${c.req.param("blob")}`));
13export default basicAuth(app.fetch);
11app.get("/edit/:blob", async (c) => c.html(`TODO: Edit ${c.req.param("blob")}`));
12app.get("/delete/:blob", async (c) => c.html(`TODO: Delete ${c.req.param("blob")}`));
13export default basicAuth(app.fetch);
18};
1920async function fetchUser(token: string): Promise<User> {
21const resp = await fetch("https://api.val.town/v1/me", {
22headers: {
23Authorization: `Bearer ${token}`,
2627if (resp.status !== 200) {
28throw new Error("Could not fetch user");
29}
3034async function isTokenValid(token) {
35try {
36const [visitor, owner] = await Promise.all([fetchUser(token), fetchUser(Deno.env.get("valtown"))]);
37return visitor.id == owner.id;
38} catch (err) {