142
143for (const url of urls) {
144 const response = await fetch(url);
145 const json = await response.json();
146
181
182 try {
183 const response = await fetch("/", {
184 method: "POST",
185 body: JSON.stringify({
60 try {
61 await cleanupDebugHtmlBlobs(gameName);
62 const html = await fetchSteamDiscussionsPage(steamUrl);
63 await saveDebugHtml(gameName, html);
64
115}
116
117async function fetchSteamDiscussionsPage(url: string): Promise<string> {
118 const response = await fetch(url, {
119 headers: {
120 "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
333 console.log("Discord Webhook Payload:", JSON.stringify(payload, null, 2));
334
335 const response = await fetch(webhookUrl, {
336 method: "POST",
337 headers: { "Content-Type": "application/json" },
12 const basic = Buffer.from(`${client_id}:${client_secret}`).toString("base64");
13
14 const response = await fetch(TOKEN_ENDPOINT, {
15 method: "POST",
16 headers: {
31 const { access_token } = await getAccessToken(client_id, client_secret, refresh_token);
32
33 const response = await fetch(NOW_PLAYING_ENDPOINT, {
34 headers: {
35 Authorization: `Bearer ${access_token}`,
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);
60 try {
61 for (const chunk of chunks) {
62 const response = await fetch(`https://api.elevenlabs.io/v1/text-to-speech/${ELON_VOICE_ID}`, {
63 method: "POST",
64 headers: {
124
125 try {
126 const response = await fetch("/chat", {
127 method: "POST",
128 body: JSON.stringify({
11
12 useEffect(() => {
13 fetchShorts();
14 }, []);
15
16 const fetchShorts = async () => {
17 try {
18 const response = await fetch('/get-shorts');
19 const data = await response.json();
20 setShorts(data);
21 } catch (err) {
22 console.error('Failed to fetch shorts', err);
23 }
24 };
40
41 try {
42 const response = await fetch('/add-short', {
43 method: 'POST',
44 headers: {
50 if (response.ok) {
51 setNewShortLink('');
52 fetchShorts();
53 }
54 } catch (err) {
172 };
173
174 const fetchWordDetails = (wordObj: { english: string, arabic: string }) => {
175 try {
176 // Use pre-generated definitions if available
188 setArabicMeaning(wordObj.arabic || 'No Arabic meaning found');
189 } catch (err) {
190 setError("Oops! Couldn't fetch word details.");
191 console.error(err);
192 }
209 setRandomWordObj(newRandomWordObj);
210
211 fetchWordDetails(newRandomWordObj);
212 };
213
1import makeFetchCookie from "npm:fetch-cookie";
2const fetchCookie = makeFetchCookie(fetch);
3
4export default async function handleCron(interval) {
5 const following = await fetchCookie(
6 "https://www.instagram.com/api/v1/friendships/375942300/following/?query=miguelse10",
7 {
16 const isFollowing = following.users.some((user) => user.username === "miguelse10");
17
18 const pushNotification = await fetchCookie("https://ntfy.sh/alEMfLpdpoXMe6jB", {
19 method: "POST",
20 body: `Mafalda ${isFollowing ? "" : "no"} lo está siguiendo a Miguel.`,
139 const url = `https://api.github.com/repos/${repo}/pulls/${prNumber}`;
140
141 const response = await fetch(url, {
142 method: "PATCH",
143 headers: {