3export async function getCNNNews() {
4 const response = await fetch(
5 "https://saurav.tech/NewsAPI/everything/cnn.json"
6 );
7 const data = await response.json();
3// Public holidays in the US in 2023
4export let holidaysUS = fetchJSON(
5 "https://date.nager.at/api/v3/PublicHolidays/2023/KR"
6);
1export function myApi(name) {
2 return "hi " + name;
3}
1export function myApi(name) {
2 return "hi " + name;
3}
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3interface APIResponse {
4 type: string;
5 crs: unknown;
9 // const url =
10 // "https://gisn.tel-aviv.gov.il/arcgis/rest/services/IView2/MapServer/860/query?where=1=1&outFields=*&f=geojson";
11 const url = "https://app.digital4grids.com/api";
12 const json_data = await fetchJSON(url);
13 return { "json_data": [] };
4 const username = "stevekrouse";
5 const user = await fetchJSON(
6 `https://api.github.com/users/${username}`,
7 );
8 console.log(user);
2
3export const buddhaRandomQuote = (async () => {
4 const resp = await fetch("https://buddha-api.com/api/random");
5 const j = await resp.json();
6 const { text, byName } = j;
5export async function annoy() {
6 const resume = resume2;
7 // const boo = await import("https://esm.sh/@atproto/api");
8 const { default: BskyAgent } = await import("npm:@atproto/api");
9 console.log(BskyAgent);
10 const agent = new BskyAgent.BskyAgent({ service: "https://bsky.social" });
50 `;
51 console.log({ prompt });
52 const response = await fetch("https://api.openai.com/v1/completions", {
53 method: "POST",
54 headers: {
55 "Content-Type": "application/json",
56 "Authorization": "Bearer " + process.env.OPENAI_API_KEY, // Replace with your OpenAI API Key
57 },
58 body: JSON.stringify({
3export function alias<P extends Params>(params: P): Promise<Result<P>> {
4 const username = params.username;
5 let url = `https://api.val.town/v1/alias/${username}`;
6 if ("valName" in params)
7 url = url + `/${params.valName}`;
6 }
7 const [author, name] = val.split(".");
8 const resp = await fetch(`https://api.val.town/v1/alias/${author}/${name}`);
9 if (resp.status !== 200) {
10 throw new Error(resp.statusText);