1import { polygonDailyAPI } from "https://esm.town/v/rwev/polygonDailyAPI";
2
3export async function polygonPriceOnDate(ticker, isoDate) {
4 const response = await polygonDailyAPI(ticker, isoDate);
5 if (response.status != "OK")
6 throw new Error(
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(count) {
2 return count + " dragons!";
3}
1export function myApi(name) {
2 console.email("hi " + name);
3}
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);
1export function myApi(name) {
2 return "hi " + name;
3}
3export const text = (async () => {
4 let mathFact = await fetchText(
5 "http://numbersapi.com/random/math",
6 );
7 return { data: `${mathFact} ${mathFact} ${mathFact}` };
1export function myApi(name) {
2 return "hi " + name;
3}
24 const params = req.params;
25 console.log(params, req);
26 const token = process.env.DISCOGS_API_TOKEN;
27 const toLowerCaseAndSort = (list: string[]) =>
28 list.map((t) => t.toLowerCase()).sort();
84 }> =>
85 fetchJSON(
86 `https://api.discogs.com/database/search?token=${token}&q=${query}${
87 isMaster ? "&type=master" : ""
88 }`
90 const getMasterRelease = async (id: string): Promise<DiscogsRelease> =>
91 fetchJSON(
92 `https://api.discogs.com/masters/${id}?token=${token}`
93 );
94 const getMainRelease = async (id: string): Promise<DiscogsRelease> =>
95 fetchJSON(
96 `https://api.discogs.com/releases/${id}?token=${token}`
97 );
98 if (params.q) {
131 }
132 res.send(
133 "No query. Use within val town: @axelav.discogs({q: 'Boards Of Canada Geogaddi'}) or as an API endpoint: https://api.val.town/eval/@axelav.discogs?q=Boards%20of%20Canada%20Geogaddi"
134 );
135}