stevensgetWeather.ts5 matches
27async function generateConciseWeatherSummary(weatherDay) {
28try {
29// Get API key from environment
30const apiKey = Deno.env.get("ANTHROPIC_API_KEY");
31if (!apiKey) {
32console.error("Anthropic API key is not configured.");
33return null;
34}
3536// Initialize Anthropic client
37const anthropic = new Anthropic({ apiKey });
3839const response = await anthropic.messages.create({
FixItWandgeolocate.ts2 matches
15.map((iface) => ({ macAddress: iface.mac }));
1617const apiKey = Deno.env.get("GOOGLE_GEOLOCATION");
18const body = { wifiAccessPoints };
1920const response = await fetch(
21`https://www.googleapis.com/geolocation/v1/geolocate?key=${apiKey}`,
22{
23method: "POST",
FixItWandGenerateWorkOrderForm.tsx2 matches
45try {
46// Submit work order with base64 encoded data
47const response = await fetch("/api/workorders/generate", {
48method: "POST",
49headers: { "Content-Type": "application/json" },
9293// Create a new work order in the user's work orders
94const response = await fetch("/api/workorders/user", {
95method: "POST",
96headers: { "Content-Type": "application/json" },
neatAmaranthCougarREADME.md2 matches
1Returns a simple privacy policy for the GPT Memory API.
23Examples of input:
4- `apiName`: `Memory API`
5- `contactEmail`: `some@email.com`
6- `lastUpdated`: `2023-11-28`
neatAmaranthCougarmain.tsx10 matches
2import { markdownToHtml } from "https://esm.town/v/xkonti/markdownToHtml";
34export const getPolicy = (apiName: string, contactEmail: string, lastUpdated: string) => {
5if (apiName == null || apiName === "") apiName = "Memory API";
6if (contactEmail == null || contactEmail === "") throw new Error("Contact email must be specified");
7if (lastUpdated == null || lastUpdated === "") throw new Error("The last updated date must be specified");
8const body = markdownToHtml(
9`# ${apiName} Privacy Policy
10Last Updated: ${lastUpdated}
1112## 1. Introduction
13Welcome to ${apiName}. This privacy policy outlines our practices regarding the collection, use, and sharing of information through ${apiName}.
1415## 2. Data Collection and Use
16${apiName} allows users to store, retrieve, list, and delete data. The data stored can be of any type as inputted by the user. We do not restrict or control the content of the data stored. ${apiName} serves as a public database accessible to anyone with an API key.
1718## 3. User Restrictions
19${apiName} does not impose age or user restrictions. However, users are advised to consider the sensitivity of the information they share.
2021## 4. Global Use
22Our API is accessible globally. Users from all regions can store and access data on ${apiName}.
2324## 5. Data Management
25Given the nature of ${apiName}, there are no user accounts or user identification measures. The API operates like a public database where data can be added, viewed, and deleted by any user. Users should be aware that any data they input can be accessed, modified, or deleted by other users.
2627## 6. Data Security
28${apiName} is protected by an API key; beyond this, there is no specific data security measure in place. Users should not store sensitive, personal, or confidential information using ${apiName}. We assume no responsibility for the security of the data stored.
2930## 7. Third-Party Involvement
31The API code is run and data is stored by val.town. They act as a third-party service provider for ${apiName}.
3233## 8. Changes to This Policy
1Returns a simple privacy policy for the GPT Memory API.
23Examples of input:
4- `apiName`: `Memory API`
5- `contactEmail`: `some@email.com`
6- `lastUpdated`: `2023-11-28`
2import { markdownToHtml } from "https://esm.town/v/xkonti/markdownToHtml";
34export const getPolicy = (apiName: string, contactEmail: string, lastUpdated: string) => {
5if (apiName == null || apiName === "") apiName = "Memory API";
6if (contactEmail == null || contactEmail === "") throw new Error("Contact email must be specified");
7if (lastUpdated == null || lastUpdated === "") throw new Error("The last updated date must be specified");
8const body = markdownToHtml(
9`# ${apiName} Privacy Policy
10Last Updated: ${lastUpdated}
1112## 1. Introduction
13Welcome to ${apiName}. This privacy policy outlines our practices regarding the collection, use, and sharing of information through ${apiName}.
1415## 2. Data Collection and Use
16${apiName} allows users to store, retrieve, list, and delete data. The data stored can be of any type as inputted by the user. We do not restrict or control the content of the data stored. ${apiName} serves as a public database accessible to anyone with an API key.
1718## 3. User Restrictions
19${apiName} does not impose age or user restrictions. However, users are advised to consider the sensitivity of the information they share.
2021## 4. Global Use
22Our API is accessible globally. Users from all regions can store and access data on ${apiName}.
2324## 5. Data Management
25Given the nature of ${apiName}, there are no user accounts or user identification measures. The API operates like a public database where data can be added, viewed, and deleted by any user. Users should be aware that any data they input can be accessed, modified, or deleted by other users.
2627## 6. Data Security
28${apiName} is protected by an API key; beyond this, there is no specific data security measure in place. Users should not store sensitive, personal, or confidential information using ${apiName}. We assume no responsibility for the security of the data stored.
2930## 7. Third-Party Involvement
31The API code is run and data is stored by val.town. They act as a third-party service provider for ${apiName}.
3233## 8. Changes to This Policy
FixItWandworkorders.ts4 matches
10}> {
11try {
12const response = await fetch("/api/workorders/user", {
13credentials: "include",
14});
38}> {
39try {
40const response = await fetch(`/api/workorders/user/${id}/send`, {
41method: "POST",
42credentials: "include",
66}> {
67try {
68const response = await fetch(`/api/workorders/user/${id}/complete`, {
69method: "POST",
70credentials: "include",
94}> {
95try {
96const response = await fetch(`/api/workorders/user/${id}`, {
97method: "DELETE",
98credentials: "include",
magicalOrangeLobstermain.tsx25 matches
73const menuRef = useRef(null);
74const isPublic = blob.key.startsWith("__public/");
75const publicUrl = isPublic ? `${window.location.origin}/api/public/${encodeURIComponent(blob.key.slice(9))}` : null;
7677useEffect(() => {
237setLoading(true);
238try {
239const response = await fetch(`/api/blobs?prefix=${encodeKey(searchPrefix)}&limit=${limit}`);
240const data = await response.json();
241setBlobs(data);
264setBlobContentLoading(true);
265try {
266const response = await fetch(`/api/blob?key=${encodeKey(clickedBlob.key)}`);
267const content = await response.text();
268setSelectedBlob({ ...clickedBlob, key: decodeKey(clickedBlob.key) });
278const handleSave = async () => {
279try {
280await fetch(`/api/blob?key=${encodeKey(selectedBlob.key)}`, {
281method: "PUT",
282body: editContent,
290const handleDelete = async (key) => {
291try {
292await fetch(`/api/blob?key=${encodeKey(key)}`, { method: "DELETE" });
293setBlobs(blobs.filter(b => b.key !== key));
294if (selectedBlob && selectedBlob.key === key) {
307const key = `${searchPrefix}${file.name}`;
308formData.append("key", encodeKey(key));
309await fetch("/api/blob", { method: "POST", body: formData });
310const newBlob = { key, size: file.size, lastModified: new Date().toISOString() };
311setBlobs([newBlob, ...blobs]);
329try {
330const fullKey = `${searchPrefix}${key}`;
331await fetch(`/api/blob?key=${encodeKey(fullKey)}`, {
332method: "PUT",
333body: "",
344const handleDownload = async (key) => {
345try {
346const response = await fetch(`/api/blob?key=${encodeKey(key)}`);
347const blob = await response.blob();
348const url = window.URL.createObjectURL(blob);
363if (newKey && newKey !== oldKey) {
364try {
365const response = await fetch(`/api/blob?key=${encodeKey(oldKey)}`);
366const content = await response.blob();
367await fetch(`/api/blob?key=${encodeKey(newKey)}`, {
368method: "PUT",
369body: content,
370});
371await fetch(`/api/blob?key=${encodeKey(oldKey)}`, { method: "DELETE" });
372setBlobs(blobs.map(b => b.key === oldKey ? { ...b, key: newKey } : b));
373if (selectedBlob && selectedBlob.key === oldKey) {
383const newKey = `__public/${key}`;
384try {
385const response = await fetch(`/api/blob?key=${encodeKey(key)}`);
386const content = await response.blob();
387await fetch(`/api/blob?key=${encodeKey(newKey)}`, {
388method: "PUT",
389body: content,
390});
391await fetch(`/api/blob?key=${encodeKey(key)}`, { method: "DELETE" });
392setBlobs(blobs.map(b => b.key === key ? { ...b, key: newKey } : b));
393if (selectedBlob && selectedBlob.key === key) {
402const newKey = key.slice(9); // Remove "__public/" prefix
403try {
404const response = await fetch(`/api/blob?key=${encodeKey(key)}`);
405const content = await response.blob();
406await fetch(`/api/blob?key=${encodeKey(newKey)}`, {
407method: "PUT",
408body: content,
409});
410await fetch(`/api/blob?key=${encodeKey(key)}`, { method: "DELETE" });
411setBlobs(blobs.map(b => b.key === key ? { ...b, key: newKey } : b));
412if (selectedBlob && selectedBlob.key === key) {
557onClick={() =>
558copyToClipboard(
559`${window.location.origin}/api/public/${encodeURIComponent(selectedBlob.key.slice(9))}`,
560)}
561className="text-blue-400 hover:text-blue-300 text-sm"
580>
581<img
582src={`/api/blob?key=${encodeKey(selectedBlob.key)}`}
583alt="Blob content"
584className="max-w-full h-auto"
660661// Public route without authentication
662app.get("/api/public/:id", async (c) => {
663const key = `__public/${c.req.param("id")}`;
664const { blob } = await import("https://esm.town/v/std/blob");
778};
779780app.get("/api/blobs", checkAuth, async (c) => {
781const prefix = c.req.query("prefix") || "";
782const limit = parseInt(c.req.query("limit") || "20", 10);
787});
788789app.get("/api/blob", checkAuth, async (c) => {
790const key = c.req.query("key");
791if (!key) return c.text("Missing key parameter", 400);
795});
796797app.put("/api/blob", checkAuth, async (c) => {
798const key = c.req.query("key");
799if (!key) return c.text("Missing key parameter", 400);
804});
805806app.delete("/api/blob", checkAuth, async (c) => {
807const key = c.req.query("key");
808if (!key) return c.text("Missing key parameter", 400);
812});
813814app.post("/api/blob", checkAuth, async (c) => {
815const { file, key } = await c.req.parseBody();
816if (!file || !key) return c.text("Missing file or key", 400);
4async function fetchRandomJoke() {
5const response = await fetch(
6"https://official-joke-api.appspot.com/random_joke",
7);
8return response.json();