2
3export const nasaImageDetails = async () => {
4 const nasaAPOD = await fetchJSON("https://api.nasa.gov/planetary/apod?api_key=DEMO_KEY");
5 let nasaImageHtml = nasaAPOD.hdurl
6 ? `<img width="100%" src="${nasaAPOD.hdurl}"/>`
3 "Access-Control-Allow-Methods": "GET,HEAD,PUT,PATCH,POST,DELETE",
4 "Access-Control-Allow-Headers":
5 "Content-Type, Access-Control-Allow-Headers, api-key",
6 "Access-Control-Max-Age": "2592000", // 30 days
7} as Record<string, string>;
15 const path = url.pathname;
16 const params = url.searchParams;
17 const apiKey = req.headers.get("api-key");
18 if (!apiKey) {
19 throw new Error("Missing API key");
20 }
21 const savedKey = Deno.env.get("QDRANT_API_KEY");
22 if (savedKey && apiKey !== savedKey) {
23 throw new Error("Invalid API key");
24 }
25 if (!params.has("cluster_id")) {
1Since [Qdrant Cloud](https://qdrant.tech/cloud/) has a fairly strict CORS policy, here's a simple val that proxies calls to Qdrant Cloud API and makes them accessible from Web apps.
2
3 To set up:
4- fork this val
5- add your `QDRANT_API_KEY` to your environment variables. This would limit usage of your proxy to your API key only.
6- start using val as a proxy
7
8Use it as a 1:1 replacement for Qdrant API, except for one additional query string parameter:
9- `cluster_id` -- the part of the Qdrant API endpoint before `cloud.qdrant.io`.
89 <a href="https://x.com/pete_millspaugh/status/1805797615197635017">started prototyping</a>{" "}
90 a simple Membrane agent. Membrane already has a few core building blocks for agents—built-in memory,
91 standardized connection to tools (APIs, timers), and really good observability—so that should be a fun area for
92 us to continue exploring.
93 </p>
30}) => {
31 const { z } = await import("npm:zod");
32 const RESY_API_URL = "https://api.resy.com";
33 const RESY_DEFAULT_HEADERS = {
34 accept: "application/json, text/plain, */*",
35 "accept-encoding": "gzip, deflate, br",
36 "accept-language": "en-US,en;q=0.9",
37 authorization: "ResyAPI api_key=\"VbWk7s3L4KiK5fzlO7JD3Q5EYolJI7n5\"",
38 "x-origin": "https://resy.com",
39 origin: "https://resy.com/",
145 )
146 }&password=${encodeURIComponent(params.password)}`;
147 const response = await fetch(`${RESY_API_URL}/3/auth/password`, {
148 method: "POST",
149 body: body,
166 seats: number;
167 }) => {
168 const url = `${RESY_API_URL}/3/details`;
169 const response = await fetch(url.toString(), {
170 method: "POST",
185 seats: number;
186 }) => {
187 const url = `${RESY_API_URL}/4/find`;
188 const searchParams = new URLSearchParams();
189 searchParams.set("lat", "0");
208 city: string;
209 }) => {
210 const url = `${RESY_API_URL}/3/venue`;
211 const searchParams = new URLSearchParams();
212 searchParams.set("url_slug", params.slug);
224 authToken: string;
225 }) => {
226 const response = await fetch(`${RESY_API_URL}/3/book`, {
227 method: "POST",
228 headers: {
9```ts
10const resyBotCron = async () => {
11 const bookingInfo = await api(@vtdocs.resyBot, {
12 slug: 'amaro-bar',
13 city: 'ldn',
1Migrated from folder: External_APIs/browserbase/browserbase_google_concerts
1Migrated from folder: External_APIs/browserbase/browserbase
75```
76
77### Lower-level API
78
79We do provide access to the lower-level getter and setters, which are useful if you are storing non-JSON or binary data, need to stream in your response or request data, or do anything else lower-level.
80
81* `async get(key: string)`: Retrieves a blob for a given key.
82* `async set(key: string, value: string | BodyInit)`: Sets the blob value for a given key. See [BodyInit](https://deno.land/api@v1.38.1?s=BodyInit).
83
84### Limitations
1import { API_URL } from "https://esm.town/v/std/API_URL";
2import { ValTownBlobError } from "https://esm.town/v/std/ValTownBlobError";
3import { ValTownBlobNotFoundError } from "https://esm.town/v/std/ValTownBlobNotFoundError";
82async function list(prefix?: string): Promise<{ key: string; size: number; lastModified: string }[]> {
83 let querystring = prefix ? `?prefix=${encodeURIComponent(prefix)}` : "";
84 const res = await fetch(`${API_URL}/v1/blob${querystring}`, {
85 headers: {
86 Authorization: `Bearer ${Deno.env.get("valtown")}`,
95
96async function delete_(key: string) {
97 const res = await fetch(`${API_URL}/v1/blob/${encodeURIComponent(key)}`, {
98 method: "DELETE",
99 headers: {
108
109async function get(key: string) {
110 const res = await fetch(`${API_URL}/v1/blob/${encodeURIComponent(key)}`, {
111 headers: {
112 Authorization: `Bearer ${Deno.env.get("valtown")}`,
124
125async function set(key: string, value: BodyInit) {
126 const res = await fetch(`${API_URL}/v1/blob/${encodeURIComponent(key)}`, {
127 method: "POST",
128 headers: {