1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const untitled_xqPioNn3 = await fetch("https://www.baidu.com");
1import process from "node:process";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
3
4export let getMe = fetchJSON(`https://api.val.town/v1/me`, {
5 headers: {
6 Authorization: `Bearer ${process.env.valtownToken}`,
1import process from "node:process";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
3
4export async function stockPriceViz(req: Request) {
7 const symbol = params.get("symbol");
8 const d = params.get("d");
9 const resData = await fetchJSON(
10 `https://www.alphavantage.co/query?function=TIME_SERIES_INTRADAY&symbol=${symbol}&interval=${d}min&apikey=${process.env.alphaVantage}`,
11 );
1import { fetch } from "https://esm.town/v/std/fetch";
2import { set } from "https://esm.town/v/std/set?v=11";
3import { lastRun } from "https://esm.town/v/logan/lastRun";
14 throw new Error("Must define WEATHER_BIT_API_KEY in secrets");
15 }
16 const res = await fetch(
17 `https://api.weatherbit.io/v2.0/current/airquality?lat=${lat}&lon=${long}&key=${apiKey}`,
18 );
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export function getPocket(params) {
4 return fetchJSON("https://getpocket.com/v3/get", {
5 method: "POST",
6 body: JSON.stringify(params),
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// Cities named Brooklyn
4export let cityLookup = fetchJSON(
5 "https://nominatim.openstreetmap.org/search.php?city=brooklyn&format=jsonv2"
6);
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function trpc(userHandle, valName) {
4 return await fetch(
5 `https://www.val.town/api/trpc/getValReferenceTypes?input={%22userHandle%22:%22${userHandle}%22,%22valName%22:%22${valName}%22}`,
6 ).then((data) => data.json());
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";
2
3export const valEval = async function (
6 const encoded = encodeURIComponent(expr.toString());
7 try {
8 const res = await fetch(`https://api.val.town/eval/${encoded}`);
9 return (await res.json()).data;
10 } catch (e) {
1import { fetchJSON } from "https://esm.town/v/val/fetchJSON";
2
3export let postWebhookTest5 = fetchJSON(
4 "https://api.val.town/express/@val.postWebhook4",
5 {