380 <title>Code Symphony</title>
381 <style>${css}</style>
382 <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap" rel="stylesheet">
383 </head>
384 <body>
417 `
418
419 const response = await fetch("https://api.github.com/graphql", {
420 method: "POST",
421 headers: {
1const API_KEY = Deno.env.get("FARCASTER_API_KEY");
2const API_URL = "https://build.wield.xyz/farcaster/v2/feed";
3
4export default async function server(request: Request): Promise<Response> {
6 let error = null;
7
8 if (!API_KEY) {
9 error = "API key is not set. Please configure the FARCASTER_API_KEY environment variable.";
10 } else {
11 async function fetchFeedItems() {
12 try {
13 const response = await fetch(`${API_URL}?limit=50`, {
14 headers: {
15 'API-KEY': API_KEY,
16 'accept': 'application/json'
17 }
27 return data.result.casts;
28 } else {
29 throw new Error("Unexpected API response structure");
30 }
31 } catch (e) {
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
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
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>