8
91. Click `Fork`
102. Change `location` (Line 4) to describe your location. It accepts fairly flexible English descriptions which it turns into locations via [nominatim's geocoder API](https://www.val.town/v/stevekrouse/nominatimSearch).
113. Click `Run`
12
5 options = {},
6) => {
7 // Initialize OpenAI API stub
8 const { Configuration, OpenAIApi } = await import(
9 "https://esm.sh/openai@3.3.0"
10 );
11 const configuration = new Configuration({
12 apiKey: process.env.OPENAI,
13 });
14 const openai = new OpenAIApi(configuration);
15 // Request chat completion
16 const messages = typeof prompt === "string"
1// This cron emails Hacker News stories from its API every 3 days.
2
3import { email } from "https://esm.town/v/std/email";
1// This cron emails Hacker News stories from its API every 3 days.
2
3import { email } from "https://esm.town/v/std/email";
1// This cron emails Hacker News stories from its API every 3 days.
2
3import { email } from "https://esm.town/v/std/email";
261 <style>${css}</style>
262 <meta name="viewport" content="width=device-width, initial-scale=1.0">
263 <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap" rel="stylesheet">
264 </head>
265 <body>
243 <style>${css}</style>
244 <meta name="viewport" content="width=device-width, initial-scale=1.0">
245 <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap" rel="stylesheet">
246 </head>
247 <body>
344 <style>${css}</style>
345 <meta name="viewport" content="width=device-width, initial-scale=1.0">
346 <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap" rel="stylesheet">
347 </head>
348 <body>
381 `;
382
383 const response = await fetch("https://api.github.com/graphql", {
384 method: "POST",
385 headers: {
1* Fork this val to your own profile.
2* Create a [Val Town API token](https://www.val.town/settings/api), open the browser preview of this val, and use the API token as the password to log in.
3
38 model: openai("gpt-4o", {
39 baseURL: "https://std-openaiproxy.web.val.run/v1",
40 apiKey: Deno.env.get("valtown"),
41 } as any),
42 messages: [