16 ["animal that barks", "discord bot"],
17 ["man bites dog", "discord bot"],
18 ["github api", "discord bot"],
19 ["chat server integration", "discord bot"],
20];
16<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
17 <ShortName>VAL VIBES: Val Town Semantic Search</ShortName>
18 <Description>Semantic search for vals using the Github API</Description>
19 <Url type="text/html" method="get" template="https://janpaul123-valtownsemanticsearch.web.val.run/search?q={searchTerms}"/>
20 <Url type="application/opensearchdescription+xml" template="https://janpaul123-valtownsemanticsearch.web.val.run/opensearch.xml"/>
1#!/usr/bin/env -S deno serve --allow-all --env --watch
2
3import { fetchAPI } from "https://esm.town/v/pomdtr/fetchAPI?v=4";
4import { Hono } from "npm:hono";
5
8
9app.get("/", async (c) => {
10 const resp = await fetchAPI("/v1/me", {
11 token,
12 });
51app.get("/vals/list", async (c) => {
52 const userID = c.req.query("user");
53 const resp = await fetchAPI(`/v1/users/${userID}/vals`, {
54 token,
55 paginate: true,
103app.get("/vals/view", async (c) => {
104 const valID = c.req.query("val");
105 const resp = await fetchAPI(`/v1/vals/${valID}`, {
106 token,
107 });
128 const { name, code, privacy, type, val } = await c.req.json();
129
130 await fetchAPI(`/v1/vals/${val}`, {
131 method: "PATCH",
132 token,
200 const { name, code, privacy, type } = await c.req.json();
201
202 const resp = await fetchAPI("/v1/vals", {
203 method: "POST",
204 token,
271app.post("/vals/delete", async (c) => {
272 const { reload, val } = await c.req.json();
273 const resp = await fetchAPI(`/v1/vals/${val}`, {
274 method: "DELETE",
275 token,
1import { API_URL } from "https://esm.town/v/std/API_URL";
2
3export async function fetchAPI(
4 path: string,
5 options?: RequestInit & {
11 if (options?.paginate) {
12 const data = [];
13 let url = new URL(`${API_URL}${path}`);
14 url.searchParams.set("limit", "100");
15
42 }
43
44 return fetch(`${API_URL}${path}`, {
45 ...options,
46 headers: {
24}
25async function getUploadURL(): Promise<string> {
26 const data = await (await fetch("https://www.val.town/api/trpc/generateImageUploadUrl", {
27 "headers": {
28 "content-type": "application/json",
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
1## 🖼️ text to image playground using [fal.ai](https://fal.ai) model apis
2
3Migrated from folder: image_gen/textToImagePlayground
26 <head>
27 <title>SQLite Explorer</title>
28 <link rel="preconnect" href="https://fonts.googleapis.com" />
29
30 <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
31 <link
32 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"
33 rel="stylesheet"
34 />
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
1// Function to upload data using Wormhole API and return the URL
2async function uploadToFileIo(file) {
3 const formData = new FormData();