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.
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.
33
34 // Post the message so we can deal with large text data.
35 await fetch(`/post-message?threadId=${input.getAttribute("data-thread-id")}`, {
36 method: "post",
37 body: msgDiv.textContent,
147 return new Response(body, { headers: { "Content-Type": "text/event-stream" } });
148});
149export default app.fetch;
75 });
76
77 self.addEventListener('fetch', (event) =>
1import { fetchTodaysNytCxPuzzle } from "https://esm.town/v/plr/fetchTodaysNytCxPuzzle";
2import type { Puzzle, PuzzleContent } from "https://esm.town/v/plr/fetchTodaysNytCxPuzzle";
3
4const formatGrid = (
10};
11
12export const fetchTodaysNytCxGridAndClues = async (
13 { filled }: { filled: boolean } = { filled: false },
14): Promise<Pick<PuzzleContent, "grid" | "clues">> => {
15 const puzzle = await fetchTodaysNytCxPuzzle();
16 const grid = formatGrid(puzzle.content.grid, { filled });
17 const clues = puzzle.content.clues;
1# DuckDB
2
3[DuckDB](https://duckdb.org/) works on Val Town, with only one small tweak! We're basically using DuckDB in the same way you'd use it with a browser - using the WASM package with its dependencies fetched from [jsdelivr](https://www.jsdelivr.com/).
4
5The only trick is to create the worker ourselves rather than using `duckdb.createWorker`. DuckDB's built-in createWorker method doesn't specify a worker type, which causes `type` to default to `classic`, and Deno (our runtime) doesn't support classic workers.
46 search.set("filter[sizeFilter][Standard]", `${standard}`);
47 url.search = search.toString();
48 return fetch(url.toString()).then(r => r.json()) as Promise<PuzzlesData>;
49};
50
51export const fetchTodaysNytCxPuzzle = async (): Promise<Puzzle> => {
52 const dateStr = new Intl.DateTimeFormat("en-US", { year: "numeric", month: "long", day: "numeric" }).format(
53 new Date(),
21 const text = formData.get('text');
22
23 const response = await fetch(window.location.href, {
24 method: 'POST',
25 body: formData
21 const source_sentence = document.getElementById('source_sentence').value;
22 const sentences = document.getElementById('sentences').value.split(',').map(sentence => sentence.trim());
23 const response = await fetch('/extract-features', {
24 method: 'POST',
25 headers: { 'Content-Type': 'application/json' },
21 const question = document.getElementById('question').value;
22 const context = document.getElementById('context').value;
23 const response = await fetch('/qa', {
24 method: 'POST',
25 headers: { 'Content-Type': 'application/json' },