11 },
12) {
13 const url = "https://api.twitter.com/2/oauth2/token";
14 const body = new URLSearchParams({
15 code,
2import OpenAI from "npm:openai";
3
4const openai = new OpenAI({ apiKey: process.env.openai });
5
6async function main() {
3export const searchArXiV = async ({ query = "", start = 0, max_results = 10 }) => {
4 const { parseStringPromise } = await import("npm:xml2js");
5 const url = new URL("https://export.arxiv.org/api/query");
6 url.searchParams.set("search_query", query);
7 url.searchParams.set("start", start);
60 ];
61 // const rawWeatherData = await fetch(
62 // `https://api.climbingweather.com/area/detail/738?days=1`,
63 // ).then((r) => r.json());
64 const rawWeatherData = await Promise.all(
66 a,
67 ) => (await fetch(
68 `https://api.climbingweather.com/area/detail/${a.id}?days=1`,
69 ).then((r) => r.json()).then((d) => ({
70 ...d,
10 <style>
11 {`
12 @import url(https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz);
13 @import url(https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic);
14 @import url(https://fonts.googleapis.com/css?family=Ubuntu+Mono:400,700,400italic);
15
16 body { font-family: 'Droid Serif'; }
1import { saveToTana } from "https://esm.town/v/lavacxx/saveToTana";
2import { APIPlainNode } from "https://esm.town/v/lavacxx/tanaTypes";
3import { Hono } from "npm:hono";
4
5const token = Deno.env.get("tanaInputAPI");
6
7export const honoTanaEndpoint = async (req: Request) => {
10 let { text = "" } = await c.req.query();
11 let node = await c.req.json();
12 let payload: APIPlainNode;
13 if (text) {
14 payload.name = text;
1export function runValAPI(name, ...args) {
2 return fetch(`https://api.val.town/v1/run/${name.replace("@", "")}`, {
3 method: "POST",
4 body: JSON.stringify({
7// Make an authenticated request to another user's val
8// Example usage: https://www.val.town/v/stevekrouse.authRequestEx
9export const runValAPIAuth = async ({ val, args, handle, privateKey, keys }: {
10 val: string;
11 args: any;
1import { runValAPIAuth } from "https://esm.town/v/stevekrouse/runValAPIAuth";
2
3// grab the types off turso's client without importing it
6
7export function turso(keys, handle?) {
8 let val = "@std.tursoAPI";
9 let f = (method) => (...args) =>
10 runValAPIAuth({
11 val,
12 args: [method, args],
2import { OpenAI } from "npm:openai";
3
4const openai = new OpenAI({ apiKey: process.env.openai });
5let chatCompletion = await openai.chat.completions.create({
6 messages: [{ role: "user", content: "Make a short joke or pun" }],