1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const trackIphoneTradein = async () => {
4 const cheerio = await import("npm:cheerio@1.0.0-rc.12");
5 const page = await fetch(
6 "https://www.apple.com/shop/browse/overlay/tradein_landing/iphone_values",
7 ).then((r) => r.text());
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const politelyinvinciblepointerHandleFormEx = (async () => {
4 let body = { args: [{ email: "example@example.com" }] };
5 const response =
6 (await fetch(
7 "https://api.val.town/v1/run/politelyinvinciblepointer.handleForm",
8 {
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export let postWebhookTest1 = fetchJSON(
4 "https://stevekrouse-postWebhook1.express.val.run",
5 {
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export const textToImageDalle = async (
16 message: string;
17 };
18 } = await fetchJSON(
19 "https://api.openai.com/v1/images/generations",
20 {
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const arenaHelpers = (async () => {
23 const url = `https://api.are.na/v2/users/${userId}/channels` +
24 (Object.keys(params).length ? `?${urlParams.toString()}` : "");
25 const response = await fetch(url, {
26 headers,
27 });
28 console.log("DEBUG", "end fetch user w channels");
29 return await response.json();
30 }
1import { fetch } from "https://esm.town/v/std/fetch";
2import process from "node:process";
3
14 };
15 const getCompletion = async () => {
16 const response = await fetch("https://api.openai.com/v1/chat/completions", {
17 method: "POST",
18 headers: {
1import { fetch } from "https://esm.town/v/std/fetch";
2import { set } from "https://esm.town/v/std/set?v=11";
3import { topHNThreadByHour } from "https://esm.town/v/elsif_maj/topHNThreadByHour";
6 // Cheerio parses markup and provides an API to interact with the resulting data structure
7 const cheerio = await import("npm:cheerio"); // You can import NPM packages
8 const reply = await fetch("https://news.ycombinator.com/");
9 const replyText = await reply.text();
10 const $ = await cheerio.load(replyText);
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export let aqi = async () => {
4 let pm25 = (
5 await fetchJSON(
6 "https://api.openaq.org/v2/latest?" +
7 new URLSearchParams({
1import { fetch } from "https://esm.town/v/std/fetch";
2import process from "node:process";
3
4export const slackWebHookMessageExample = (async () => {
5 const res = await fetch(process.env.slackWebhookURL, {
6 method: "POST",
7 body: JSON.stringify({
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export const telegramGetUpdates = async (botToken: string) =>
4 fetchJSON(
5 `https://api.telegram.org/bot${botToken}/getUpdates`,
6 );