113
114 if (working) {
115 return c.text("Sorry, another embedding is being fetched, wait a moment and try again")
116 }
117
274})
275
276export default app.fetch
7The `posts` directory contains markdown files.
8It also includes an `index.json` with an array of posts for the blog.
9These posts are fetched as markdown then processed with graymatter and remark to convert them into metadata and HTML.
10
11The `www` val serves the site using the `src/hono-adapter`.
26
27 try {
28 const response = await fetch("/", {
29 method: "POST",
30 headers: { "authorization": "Bearer " + bearerToken },
26
27export async function generateCodeAnthropic(messages: Message[]): Promise<ValResponse | null> {
28 const system = await (await fetch(`${import.meta.url.split("/").slice(0, -1).join("/")}/system_prompt.txt`)).text();
29
30 const openai = new OpenAI({
5 if (url.pathname == "/js/entry.client.js") {
6 const moduleUrl = new URL("./entry.client.tsx", import.meta.url);
7 return fetch(moduleUrl);
8 }
9 return handler(request);
155 * The main App component is rendered on the client.
156 * No server-side-specific code should be included in the App.
157 * Use fetch to communicate with the backend server portion.
158 */
159function App() {
178 * Server-only code
179 * Any code that is meant to run on the server should be included in the server function.
180 * This can include endpoints that the client side component can send fetch requests to.
181 */
182export default async function server(request: Request): Promise<Response> {
13 if (working) {
14 return Response.json({
15 error: "Sorry, another embedding is being fetched, wait a moment and try again",
16 })
17 }
1console.log("hi");
2await fetch("https://shouser--83d37324cc6c11efb88ce6cdfca9ef9f.web.val.run?normalscriptval=true")
3 .then(response => console.log(response.json()))
4 .then(data => console.log(data))
17}
18
19// Helper function to fetch SVG and convert to base64
20async function fetchSVGAsBase64(url: string): Promise<string> {
21 const response = await fetch(url);
22 if (!response.ok) {
23 throw new Error(`Failed to fetch SVG: ${response.status} ${response.statusText}`);
24 }
25 const svgText = await response.text();
48
49 try {
50 // Fetch SVG from the specified URL
51 const svgDataUri = await fetchSVGAsBase64("https://alexwein-fabwbogglelike.web.val.run/?svg=1");
52
53 // Upload blob to Bluesky
19 : Math.floor((Date.now() - 2 * 24 * 60 * 60 * 1000) / 1000);
20
21 // Fetch and log tweets
22 const response = await socialDataSearch(`${query} since_time:${timeFrame}`);
23 console.log("Response from socialDataSearch:", response);