27 ].map(two_decimals).join(","),
28 language: "native",
29 key: Deno.env.get("OPENCAGE_API_KEY"),
30 });
31
32 const { results: [first] } = await fetch(`https://api.opencagedata.com/geocode/v1/json?${searchParams}`)
33 .then(response => response.json())
34 .then(json => parse(schema, json))
1[WebSim](https://x.com/websim_ai) on Val with Substrate
2
3🪩 To fork, [sign up for Substrate](https://substrate.run/signin) to get your own API key and $50 free credits
2import { ComputeText, GenerateImage, sb, Substrate, UpscaleImage } from "npm:substrate";
3
4const substrate = new Substrate({ apiKey: Deno.env.get("SUBSTRATE_API_KEY") });
5
6export default async function render(req: Request): Promise<Response> {
17 }
18
19 const resp = await fetch("https://api.pushover.net/1/messages.json", {
20 headers: {
21 "Content-Type": "application/json",
9To use it on your own Val Town SQLite database, [fork it](https://www.val.town/v/stevekrouse/sqlite_admin/fork) to your account.
10
11It uses [basic authentication](https://www.val.town/v/pomdtr/basicAuth) with your [Val Town API Token](https://www.val.town/settings/api) as the password (leave the username field blank).
30```
31
32## API Reference
33
34### Class: ReadmeWriter
43
44- `model` (optional): The model to be used for generating the readme. Defaults to "gpt-3.5-turbo".
45- `apiKey` (optional): An OpenAI API key. Defaults to `Deno.env.get("OPENAI_API_KEY")`.
46
47#### Methods
6 model: string;
7 openai: OpenAI;
8 apiKey: string;
9 valtownKey: string;
10
32 private async getVal(username: string, valName: string) {
33 try {
34 const res = await fetch(`https://api.val.town/v1/alias/${username}/${valName}`, {
35 method: "GET",
36 headers: {
72 private async updateReadme(id: string, readme: string) {
73 try {
74 const res = await fetch(`https://api.val.town/v1/vals/${id}`, {
75 method: "PUT",
76 headers: {
13## Authentication
14
15Login to your SQLite Explorer with [password authentication](https://www.val.town/v/pomdtr/password_auth) with your [Val Town API Token](https://www.val.town/settings/api) as the password.
16
17## Todos / Plans
27 <head>
28 <title>SQLite Explorer</title>
29 <link rel="preconnect" href="https://fonts.googleapis.com" />
30
31 <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
32 <link
33 href="https://fonts.googleapis.com/css2?family=Fira+Code:wght@300..700&family=Source+Sans+3:ital,wght@0,200..900;1,200..900&display=swap"
34 rel="stylesheet"
35 />
10// PubMed search function (modified to accept more parameters)
11async function pubmedSearch(query, userId, additionalParams = {}) {
12 const url = 'https://www.pubmedisearch.com/api/fetch_articles';
13 const options = {
14 method: 'POST',
56 return c.json(results);
57 } catch (error) {
58 console.error('API error:', error);
59 return c.json({ error: 'An error occurred while processing your request' }, 500);
60 }
74 return c.json(results);
75 } catch (error) {
76 console.error('API error:', error);
77 return c.json({ error: 'An error occurred while processing your request' }, 500);
78 }