3export const getPublicVals = async (username) => {
4 let { id } = await fetchJSON(
5 `https://api.val.town/v1/alias/${username}`,
6 );
7 return fetchJSON(
8 `https://api.val.town/v1/users/${id}/vals`,
9 );
10};
1import { TEST_API } from "https://esm.town/v/stevekrouse/TEST_API";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
3
16}) {
17 const { data: last } = await fetchJSON(
18 `${TEST_API}/eval/${stateName}`
19 );
20 const now = Date.now();
21 await fetchJSON(
22 `${TEST_API}/eval/${mutator(now)}`
23 );
24 const { data: next } = await fetchJSON(
25 `${TEST_API}/eval/${stateName}`
26 );
27 const mutated = next === now;
1export const untitled_oliveSwordtail = (async () => {
2 var name = "hank";
3 function myApi(name) {
4 return "hi " + name;
5 }
1export function myApi(name) {
2 return "hi " + name;
3}
1export function myApi(name) {
2 return "hi " + name;
3}
2
3export const fetchGiphy = (async (searchTerm) => {
4 const { GiphyFetch } = await import("npm:@giphy/js-fetch-api");
5 const gf = new GiphyFetch(process.env.giphyApiKey);
6 const { data: gifs } = await gf.search(searchTerm, { limit: 10 });
7 return gifs;
1export function myApi(name) {
2 return "hi " + name;
3}
3// Predict the nationality of a name
4export let nameNationality = fetchJSON(
5 "https://api.nationalize.io/?name=michael"
6);
1export function myApi(name) {
2 return "hi " + name;
3}
19 const token = process.env.OAUTH_CLIENT_ID + ":" +
20 process.env.OAUTH_CLIENT_SECRET;
21 const response = await fetch("https://api.notion.com/v1/oauth/token", {
22 method: "POST",
23 headers: {