1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const proxyFetch1 = async (req, res) => {
4 const { url, options } = req.body;
5 try {
6 const response = await fetch(url, options);
7 return res.status(response.status).send(await response.text());
8 } catch (e) {
9 const errorMessage = e instanceof Error ? e.message : "Unknown error";
10 console.error("Failed to initiate fetch", e);
11 return res.status(500).send(`Failed to initiate fetch: ${errorMessage}`);
12 }
13};
1import { fetch } from "https://esm.town/v/std/fetch";
2import { rule } from "https://esm.town/v/cescyang/rule";
3
7 "https://sapphire.api.microsoftapp.net/config/api/v1/get?setmkt=en-us&setplatform=android&setchannel=production&settenant=sapphire-bing";
8 try {
9 const response = await fetch(url, {
10 method: "GET",
11 });
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let webhook2 = (params) => {
4 untitled6313446 = fetch(
5 "https://market-backend.api.2gis.ru/5.0/product/items?q=water&point1=37.87550034485333,51.32652258650344&point2=37.94900977933917,51.293266520365684&locale=ru_RU&page=1&page_size=12&feature_config=categories_without_fake_first_level,range_price_type_supported,from_price_type_supported"
6 ).then((x) => console.log(x));
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const extractOnThisDayStory = async () => {
12 `https://api.wikimedia.org/feed/v1/wikipedia/en/onthisday/all/${MM}/${DD}`;
13 try {
14 const response = await fetch(url);
15 const data = await response.json();
16 const newsEvents = data.events; // We assume that 'events' category is most likely to contain news articles.
24 }
25 catch (error) {
26 console.log("Error fetching On This Day content:", error);
27 return `An error occurred while fetching the On This Day content. ${error}`;
28 }
29 };
1import { daysAgoFromToday } from "https://esm.town/v/ramkarthik/daysAgoFromToday";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
3
4export const staleGithubPRs = async (
14 },
15 };
16 let data = await fetchJSON(
17 `https://api.github.com/repos/${owner}/${repo}/pulls`,
18 options,
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export const raindropBookmarks = async (
8 "headers": { "Authorization": "Bearer " + raindropToken },
9 };
10 let data = await fetchJSON(
11 "https://api.raindrop.io/rest/v1/raindrops/0?perpage=20&page=" + page,
12 options,
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// Github profile
4export let githubUser = fetchJSON(
5 "https://api.github.com/users/stevekrouse"
6);
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// Returns NASA's Astronomy Picture of the Day (APOD)
4export const nasaAPOD = fetchJSON("cutt.ly/T7ksirK");
5// Forked from @iBrokeit.nasaAPOD
1import process from "node:process";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
3
4export async function polygonDailyAPI(ticker, date) {
5 return fetchJSON(
6 `https://api.polygon.io/v1/open-close/${ticker}/${date}?adjusted=true&apiKey=${process.env.POLYGON_API_KEY}`
7 );
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// Github profile
4export let githubUser = fetchJSON(
5 "https://api.github.com/users/stevekrouse"
6);