blob_adminREADME.md1 match
9[](https://www.val.town/v/stevekrouse/blob_admin_app/fork)
1011It 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).
1213# TODO
readwiseHighlightsmain.tsx2 matches
11queryParams.append("pageCursor", nextPageCursor);
12}
13console.log("Making export api request with params " + queryParams.toString());
14const response = await fetch("https://readwise.io/api/v2/export/?" + queryParams.toString(), {
15method: "GET",
16headers: {
readwiseHighlightsREADME.md1 match
1https://readwise.io/api_deets
23Not sure how to convert from a reader ID (string) to a readwise ID (number)
readwiseReaderDocumentListmain.tsx2 matches
43queryParams.append("location", location);
44}
45console.log("Making export api request with params " + queryParams.toString());
46const response = await fetch("https://readwise.io/api/v3/list/?" + queryParams.toString(), {
47method: "GET",
48headers: {
1Reader docs here: https://readwise.io/reader_api
23Adapted from the example code. Fetches items from Readwise Reader given a token, and optional updatedAfter and location parameters.
readwiseReaderReadItemsRssREADME.md2 matches
1Creates an RSS feed of my read items from Readwise Reader.
23Reader docs here: https://readwise.io/reader_api
45In 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.
67Ideally 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.
valTownChatGPTmain.tsx1 match
3import { renderToString } from "npm:react-dom/server";
45// This uses by personal API key, you'll need to provide your own if
6// you fork this. We'll be adding support to the std/openai lib soon!
7const openai = new OpenAI();
fetchTodaysNytCxPuzzlemain.tsx2 matches
37mini?: boolean;
38}): Promise<PuzzlesData> => {
39// https://api.foracross.com/api/puzzle_list?page=0&pageSize=50&filter%5BnameOrTitleFilter%5D=ny%20times%20june%2019%202024&filter%5BsizeFilter%5D%5BMini%5D=true&filter%5BsizeFilter%5D%5BStandard%5D=true
40const url = new URL("https://api.foracross.com/api/puzzle_list");
41const search = new URLSearchParams();
42search.set("page", `${page}`);
1const HUGGING_FACE_API_URL = "https://api-inference.huggingface.co/models";
2const HUGGING_FACE_API_KEY = Deno.env.get("HUGGING_FACE_API_KEY");
34const defaultModels = {
6061async featureExtraction(input, options) {
62return this.callHuggingFaceAPI(input, options);
63}
6465async textClassification(input, options) {
66return this.callHuggingFaceAPI(input, options);
67}
6869async tokenClassification(input, options) {
70return this.callHuggingFaceAPI(input, options);
71}
7273async questionAnswering(input, options) {
74return this.callHuggingFaceAPI(input, options);
75}
7677async summarization(input, options) {
78return this.callHuggingFaceAPI(input, options);
79}
8081async translation(input, options) {
82return this.callHuggingFaceAPI(input, options);
83}
8485async textGeneration(input, options) {
86return this.callHuggingFaceAPI(input, options);
87}
8889async sentenceSimilarity(input, options) {
90return this.callHuggingFaceAPI(input, options);
91}
9293async callHuggingFaceAPI(payload, options) {
94try {
95const response = await fetch(`${HUGGING_FACE_API_URL}/${this.model}`, {
96method: "POST",
97headers: {
98"Authorization": `Bearer ${HUGGING_FACE_API_KEY}`,
99"Content-Type": "application/json"
100},
104if (!response.ok) {
105const error = await response.json();
106console.error("Hugging Face API Error:", error);
107return { error: `API request failed: ${error.error}` };
108}
109111return data;
112} catch (error) {
113console.error("Error calling Hugging Face API:", error);
114return { error: "Error calling Hugging Face API" };
115}
116}
verifyTokenmain.tsx1 match
1async function fetchUser(token: string): Promise<{ id: string }> {
2const resp = await fetch("https://api.val.town/v1/me", {
3headers: {
4Authorization: `Bearer ${token}`,