1export const googleClient = async () => {
2 const { google } = await import("npm:googleapis");
3 const key = { client_id: "test", client_secret: "test" };
4 const client = new google.auth.OAuth2(key.client_id, key.client_secret, [
1import { spotifyAPI } from "https://esm.town/v/stevekrouse/spotifyAPI";
2
3export let spotifySearch = ({...params}) => spotifyAPI({
4 endpoint: 'search',
5 ...params
5export const getMuniStopInfo = (stopCode) => {
6 return fetchJSON(
7 `https://api.511.org/transit/StopMonitoring?api_key=${process.env.transitApiKey}&agency=SF&stopCode=${stopCode}`,
8 );
9};
1import { HNcache } from "https://esm.town/v/akkartik/HNcache";
2
3// traverse parent links up to story, but don't make any API requests
4export let hnStoryPure = async (post) => {
5 while (post.parent) {
1export function myApi(name, color = "blue") {
2 return `Hello ${name}, your favorite color is ${color}.`;
3}
1export function myApi(name) {
2 return "hi " + name;
3}
3// GitHub events
4export let githubEvents = fetchJSON(
5 "https://api.github.com/users/stevekrouse/events"
6);
9 shortForecast: string;
10 }
11 interface WeatherApiResponse {
12 properties: {
13 periods: Forecast[];
21 // Fetch the points data to get the forecast endpoint
22 const pointsUrl: string =
23 `https://api.weather.gov/points/${latitude},${longitude}`;
24 console.log(pointsUrl);
25 const pointsResponse = await fetch(pointsUrl, {
33 headers: { "Accept": "application/geo+json" },
34 });
35 const forecastData: WeatherApiResponse = await forecastResponse.json();
36 console.log({ forecastData });
37 return forecastData.properties.periods;
1export function myApi(name) {
2 return "hi " + name;
3}
21
22 const getCompelitoins = async (data) => {
23 const response = await fetch("https://api.openai.com/v1/completions", {
24 method: "POST",
25 headers: {