1// https://developer.mozilla.org/en-US/docs/Web/API/btoa
2import { Buffer } from "node:buffer";
3
3// Github profile
4export let githubUser = fetchJSON(
5 "https://api.github.com/users/stevekrouse"
6);
2
3export let eval_ = (code, args?) =>
4 fetchJSON("https://api.val.town/v1/eval", {
5 method: "POST",
6 body: JSON.stringify({
1import { runVal } from "https://esm.town/v/std/runVal";
2
3export const rimeAPIEx = await runVal("stevekrouse.rime", {
4 text: "hello friend",
5 speaker: "young_female_latina-4",
3export function discordMessages({ botToken, channelId }) {
4 return fetchJSON(
5 `https://discord.com/api/channels/${channelId}/messages`,
6 {
7 headers: {
2
3export let hnSearchByDate = (params) => fetchJSON(
4 `http://hn.algolia.com/api/v1/search_by_date?${new URLSearchParams(params)}`
5)
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let arenaApiExample = (async () => {
4 const resp = await fetch(
5 "http://api.are.na/v2/channels/that-glassy-dark-design-style",
6 );
7 const json = await resp.json();
2
3export let runGET = fetchJSON(
4 `https://api.val.town/v1/run/stevekrouse.add?args=${JSON.stringify([1, 2])}`,
5);
1export const axiosEx = (async () => {
2 const { default: axios } = await import("https://esm.sh/axios");
3 let r = await axios.get("https://api.github.com/users/stevekrouse/following");
4 return JSON.stringify(r);
5})();
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 );
7 return await response.json();