1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export let spotifyAPI = ({token, endpoint, ...params}) => fetchJSON(
4 `https://api.spotify.com/v1/${endpoint}?${new URLSearchParams(params)}`,
5 {
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export let runPOST = fetchJSON(
4 `https://api.val.town/v1/run/stevekrouse.add`,
5 {
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let curl = async (url: string, options?: RequestInit) => {
4 const response = await fetch(url, options);
5 const headers = Object.fromEntries(response.headers.entries());
6 const body = await response.text();
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3// token_type = 'Bot' | 'Bearer'
4export let discordAPI = ({path, tokenType, token}) => fetchJSON(
5 `https://discord.com/api/${path}`,
6
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export let discordFetch = (token, route) => fetchJSON(
4 `https://discord.com/api/${route}`,
5 {
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export let testWebhook = fetchJSON("https://api.val.town/eval/@stevekrouse.webhook", {method: "POST"})
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export let hnGetMaxId = () => fetchJSON(
4 `https://hacker-news.firebaseio.com/v0/maxitem.json?print=pretty`
5)
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let fetchHeaders2 = Object.fromEntries(
4 (await fetch("https://swapi.dev/api/people/1/")).headers
5);
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export async function hootsuiteNasa(req: express.Request, res: express.Response) {
17 uri = decodeURIComponent(req.query.cursor);
18 }
19 var results = await fetchJSON(uri);
20 var i;
21 for (i = 0; i < results.collection.items.length; i++) {
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let valTownApiExampleVal = (async () => {
4 const response = await fetch(
5 `https://api.val.town/v1/alias/tmcw/valTownApiExampleVal`,
6 );