46 console.log("hi");
47
48 fetch("https://api.val.town/v1/run/jonbo.fetchBcycleCounts")
49 .then((response) => {
50 if (!response.ok) {
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3// accessible via API at https://api.val.town/eval/@stevekrouse.basicAPIEx
4export const basicAPIEx = fetchJSON(
5 "https://date.nager.at/api/v2/publicholidays/2023/US"
6);
7// Bonus: the whole runtime is available in the URL Bar 🤯
8// ie https://api.val.town/eval/"The first holiday is "+ @stevekrouse.basicAPIEx[0].name
4export const valBeeExample = async () => {
5 return (valbeeTest = fetchText(
6 "http://numbersapi.com/random/math"
7 ));
8};
12 twitterJSON({
13 url: handle
14 ? `https://api.twitter.com/2/users/by/username/${handle}`
15 : `https://api.twitter.com/2/users/${id}`,
16 bearerToken,
17 });
1export function myApi(name) {
2 return "hi " + name;
3}
3// Random math fact
4export let mathFact = fetchText(
5 "http://numbersapi.com/random/math"
6);
1export function myApi(name: Interval) {
2 console.email("hi " + name);
3}
5 const articlesDatabase = initDatabase({
6 appId: process.env.MONGODB_ARTICLES_APP_ID,
7 apiKey: process.env.MONGODB_ARTICLES_API_KEY,
8 databaseName: "medium",
9 });
1export function myApi(name) {
2 return "hi " + name;
3}
3// Github profile
4export let githubUser = fetchJSON(
5 "https://api.github.com/users/hultner"
6);