1import process from "node:process";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
3
4export const likedUpdated = async (interval: Interval) => {
7 return;
8 }
9 const res = await fetchJSON(
10 "https://api.val.town/v1/me/likes",
11 {
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let getDictCSV = async () => {
4 const CSV_URL = "https://docs.google.com/spreadsheets/d/e/2PACX-1vSaIstzxO8d2J37TZjcFQfk4cN3unhuq_e-SD5L6pLvwSxrg-h836e8uIyWmuxjsG3LIbcxKLxO_8aZ/pub?output=csv";
5 const csvString = (await fetch(CSV_URL)).text();
6 return csvString;
7}
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let map = async (zipA, latB, longB) => {
4 let f = await fetch(
5 `https://maps.googleapis.com/maps/api/staticmap?auto=&scale=2&size=600x300&maptype=roadmap&format=png&key=AIzaSyBkrVgpa0Ul-_LN7cVq8ws6oYfQi3zCjuU&markers=size:mid%7Ccolor:0xdc2626%7Clabel:1%7CLos%20Angeles%2CCA%2C${zipA}&markers=size:mid%7Ccolor:0xdc2626%7Clabel:2%7C${latB}%2C${longB}`
6 );
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// Explore the Star Wars universe, from StarWarsAPI
4export let starWars = fetchJSON(
5 "https://swapi.dev/api/people/1/"
6);
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// Predict the nationality of a name
4export let nameNationality = fetchJSON(
5 "https://api.nationalize.io/?name=michael"
6);
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// GitHub events
4export let githubEvents = fetchJSON(
5 "https://api.github.com/users/stevekrouse/events",
6);
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// Returns NASA's Astronomy Picture of the Day (APOD)
4export const nasaAPOD = fetchJSON("cutt.ly/T7ksirK");
5// Forked from @iBrokeit.nasaAPOD
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3// Github profile
4export let githubUser = fetchJSON(
5 "https://api.github.com/users/stevekrouse"
6);
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export let eval_ = (code, args?) =>
4 fetchJSON("https://api.val.town/v1/eval", {
5 method: "POST",
6 body: JSON.stringify({
1import { fetch } from "https://esm.town/v/std/fetch";
2
3// E.g. from a user's perspective (not the real execution time!)
7 for (let i = 0; i < count; i++) {
8 let start = Date.now();
9 await fetch("https://api.val.town/eval/(()=%3E1+1)()");
10 evalTimes.push(Date.now() - start);
11 }
22 for (let i = 0; i < count; i++) {
23 let start = Date.now();
24 await fetch("https://api.val.town/eval/@healeycodes.addOnes()");
25 userFuncTimes.push(Date.now() - start);
26 }