1import { fetch } from "https://esm.town/v/std/fetch";
2import { API_URL } from "https://esm.town/v/std/API_URL";
3
4export function runVal(name, ...args) {
5 return fetch(`${API_URL}/v1/run/${name.replace("@", "")}`, {
6 method: "POST",
7 body: JSON.stringify({
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let valTownApiExampleSearch = (async () => {
4 const query = new URLSearchParams({ query: "lodash", limit: "4" });
5 const response = await fetch(`https://api.val.town/v1/search/vals?${query}`);
6 const json = await response.json();
7 return json;
3export let blocks_inner = async (req, res) => {
4 const [_, user, id, ...file] = req.path.split("/");
5 const gist = await fetch(`https://api.github.com/gists/${id}`).then((r) =>
6 r.json()
7 );
1// set by stevekrouse.checkIfTwitterAPIIsDown at 2023-05-09T17:45:30.441Z
2export let twitterAPIDown = {
3 "down": false,
4 "reason": "search returned 4 results at Tue May 09 2023 17:45:30 GMT+0000 (Coordinated Universal Time)"
1import { geoffApiSecret } from "https://esm.town/v/stevekrouse/geoffApiSecret";
2
3export const geoffApi = ({ secret }) => {
4 if (secret !== geoffApiSecret) return "Bad secret";
5};
3export let vid = async (name) =>
4 (await fetchJSON(
5 `https://api.val.town/v1/alias/${name.replace(".", "/").replace("@", "")}`,
6 )).id;
2import { spotifyGetToken } from "https://esm.town/v/stevekrouse/spotifyGetToken";
3import { discoverWeeklySearch } from "https://esm.town/v/stevekrouse/discoverWeeklySearch";
4import { spotifyAPI } from "https://esm.town/v/stevekrouse/spotifyAPI";
5
6export let discoverWeeklyTracks = spotifyAPI({
7 endpoint: `playlists/${discoverWeeklySearch.playlists.items.at(0).id}/tracks`,
8 token: (await spotifyGetToken(spotifyDoNotShareState)).access_token,
48 preferredUsername: `bot`,
49 summary: `Photos from ${DOMAIN}.com`,
50 inbox: `https://${DOMAIN}/api/inbox`,
51 followers: `https://${DOMAIN}/u/bot/followers`,
52 icon: {
1import { discordAPI } from "https://esm.town/v/stevekrouse/discordAPI";
2
3// https://discord.com/developers/docs/resources/channel#get-channel-messages
4export let discordGetMessages = ({token, tokenType, channelId}) => discordAPI({
5 token,
6 tokenType,
6 const { parse } = await import("https://deno.land/x/xml/mod.ts");
7 const res: any = await fetch(
8 "https://bizfileonline.sos.ca.gov/api/FilingDetail/business/4603/false",
9 {
10 headers: {