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 />
1# OpenAI - [Docs ↗](https://docs.val.town/std/openai)
2
3Use OpenAI's chat completion API with [`std/openai`](https://www.val.town/v/std/openai). This integration enables access to OpenAI's language models without needing to acquire API keys.
4
5For free Val Town users, [all calls are sent to `gpt-3.5-turbo`](https://www.val.town/v/std/openaiproxy?v=5#L69).
34If these limits are too low, let us know! You can also get around the limitation by using your own keys:
35
361. Create your own API key on [OpenAI's website](https://platform.openai.com/api-keys)
372. Create an [environment variable](https://www.val.town/settings/environment-variables?adding=true) named `OPENAI_API_KEY`
383. Use the `OpenAI` client from `npm:openai`:
39
9[](https://www.val.town/v/stevekrouse/blob_admin_app/fork)
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).
12
13# TODO
11 queryParams.append("pageCursor", nextPageCursor);
12 }
13 console.log("Making export api request with params " + queryParams.toString());
14 const response = await fetch("https://readwise.io/api/v2/export/?" + queryParams.toString(), {
15 method: "GET",
16 headers: {
1https://readwise.io/api_deets
2
3Not sure how to convert from a reader ID (string) to a readwise ID (number)
43 queryParams.append("location", location);
44 }
45 console.log("Making export api request with params " + queryParams.toString());
46 const response = await fetch("https://readwise.io/api/v3/list/?" + queryParams.toString(), {
47 method: "GET",
48 headers: {
4export async function readwiseReaderReadItemsRss() {
5 // Get all of a user's archived documents
6 const archivedData = await readwiseReaderDocumentList(Deno.env.get("readwiseReaderApiToken"), undefined, "archive");
7
8 // Later, if you want to get new documents updated after some date, do this:
9 // const docsAfterDate = new Date(Date.now() - 24 * 60 * 60 * 1000); // use your own stored date
10 // const newData = await fetchDocumentListApi(docsAfterDate.toISOString());
11
12 return new Response(dataToRSS(
1Reader docs here: https://readwise.io/reader_api
2
3Adapted from the example code. Fetches items from Readwise Reader given a token, and optional updatedAfter and location parameters.
1Creates an RSS feed of my read items from Readwise Reader.
2
3Reader docs here: https://readwise.io/reader_api
4
5In order to get read items from Readwise Reader -> Workflowy, this turns the read items (aka "archive") into an RSS feed, which Zapier picks up, and creates bullets in Workflowy.
6
7Ideally would store the generated RSS or the last fetch date, and only get new items, but for now `readwiseReaderDocumentList` re-fetches the full history each time.