10 try {
11 log && console.log("provideBlob.poll attempt", url);
12 const res = await fetch(url, {
13 headers: {
14 "Content-Type": "application/octet-stream",
54});
55
56export default app.fetch;
57
58 const allComments = [];
59 async function fetchComments(pageToken: string = ""): Promise<void> {
60 const url =
61 `https://www.googleapis.com/youtube/v3/commentThreads?key=${API_KEY}&textFormat=plainText&part=snippet&allThreadsRelatedToChannelId=${CHANNEL_ID}&pageToken=${pageToken}`;
62
63 const response = await fetch(url);
64 const data = await response.json();
65
85 }
86
87 // If there's a next page, fetch more comments recursively
88 if (data.nextPageToken) {
89 fetchComments(data.nextPageToken);
90 }
91 }
92
93 await fetchComments();
94
95 const newComments = await sqlite.execute({
150});
151
152export default basicAuth(app.fetch);
4 const now = new Date();
5 const url = "https://agmm.xyz/";
6 const r = await fetch(url);
7
8 console.log("Response", r);
5 async function request(url) {
6 console.log(url);
7 const res = await fetch(url);
8 return load(await res.text());
9 }
1Migrated from folder: bluesky/fetchBlueskyPost
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function fetchTweet(url) {
4 const tweetId = url.match(/(\d{19})/)[1];
5 const token = getToken(tweetId);
8 tweetURL.searchParams.set("lang", "en");
9 tweetURL.searchParams.set("token", token);
10 const res = await fetch(tweetURL, {
11 redirect: "follow",
12 });
15}
16
17// @see: https://github.com/vercel/react-tweet/blob/a292ca7/packages/react-tweet/src/api/fetch-tweet.ts#L27-L31
18function getToken(id: string) {
19 return ((Number(id) / 1e15) * Math.PI)
1Migrated from folder: a0_forks/fetchTweet
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3await fetchJSON("https://api.val.town/v1/vals", {
4 headers: {
5 Authorization: `Bearer ${Deno.env.get("valtown")}`,