4
5async function createScreenshot(code: string) {
6 const apiUrl = "https://sourcecodeshots.com/api/image";
7 const resp = await fetch(apiUrl, {
8 method: "POST",
9 headers: {
39 }
40 }
41 const resp = await fetch(`https://api.val.town/v1/alias/${author}/${name}`, {
42 headers,
43 });
50 const version = url.searchParams.get("v");
51 const resp = await fetch(
52 `https://api.val.town/v1/vals/${val.id}/versions/${version}`,
53 { headers },
54 );
1```
2curl 'https://taras-free_open_router.web.val.run/api/v1/chat/completions' \
3 -H 'accept: application/json' \
4 -H 'authorization: Bearer THIS_IS_OVERRIDEN_ON_SERVER' \
9
10export const stylesheets = [
11 "https://fonts.googleapis.com/css?family=Roboto:300,300italic,700,700italic",
12 "https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.css",
13 "https://cdnjs.cloudflare.com/ajax/libs/milligram/1.4.1/milligram.css",
2import { markdownToHtml } from "https://esm.town/v/xkonti/markdownToHtml";
3
4export const getPolicy = (apiName: string, contactEmail: string, lastUpdated: string) => {
5 if (apiName == null || apiName === "") apiName = "Memory API";
6 if (contactEmail == null || contactEmail === "") throw new Error("Contact email must be specified");
7 if (lastUpdated == null || lastUpdated === "") throw new Error("The last updated date must be specified");
8 const body = markdownToHtml(
9 `# ${apiName} Privacy Policy
10Last Updated: ${lastUpdated}
11
12## 1. Introduction
13Welcome to ${apiName}. This privacy policy outlines our practices regarding the collection, use, and sharing of information through ${apiName}.
14
15## 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.
17
18## 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.
20
21## 4. Global Use
22Our API is accessible globally. Users from all regions can store and access data on ${apiName}.
23
24## 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.
26
27## 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.
29
30## 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}.
32
33## 8. Changes to This Policy
2 const url = new URL(req.url);
3 const path = url.searchParams.get("path");
4 const apiUrl = new URL(path, "https://api.company-information.service.gov.uk/");
5 const apiKey = Deno.env.get("companiesHouseApiKey");
6 const basicAuth = btoa(apiKey + ":");
7 const response = await fetch(apiUrl, {
8 headers: { Authorization: `Basic ${basicAuth}` },
9 });
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=44";
2import { google } from "npm:googleapis";
3
4export async function getAccessToken(accountId: string, bearer = Deno.env.get("pipedream")) {
5 const response = await fetchJSON(
6 `https://api.pipedream.com/v1/accounts/${accountId}?include_credentials=1`,
7 { bearer },
8 );
1# Pipedream helpers
2
3Pipedream offers an Accounts API to handle OAuth for you, automatically, and for free. [How to do it is covered in this guide](https://docs.val.town/integrations/google-sheets/#use-pipedreams-accounts-api).
4
5The helper functions below can make it easier to work with various Google API. For example, I used them like so to get all my free/busy times for this week from all my google calendars:
6
7```ts
37```
38
39In order for this to work you need to follow the instructions in [this guide](https://docs.val.town/integrations/google-sheets/#use-pipedreams-accounts-api) to save your pipedream API key into your [Val Town Environment Variables](/settings/environment-variables) under `pipedream`, then connect the google account you care about to Pipedream, and copy it's Pipedream "account id" into your val code. Let me know if you need any help by commenting on this val!
40
41Migrated from folder: Archive/pipedream
8
91. Click `Fork`
102. Change `location` (Line 4) to describe your location. It accepts fairly flexible English descriptions which it turns into locations via [nominatim's geocoder API](https://www.val.town/v/stevekrouse/nominatimSearch).
113. Click `Run`
12
6 return zodToJsonSchema(schema, {
7 name: "schema",
8 target: "openApi3",
9 }).definitions.schema;
10}
61}
62
63export function getOpenApiSpec(
64 url: string,
65 title: string,
69) {
70 return {
71 openapi: "3.1.0",
72 info: {
73 title,
5At [OurTechnology](https://ourtechnology.co), we create technology solutions to empower and equip those who serve the homeless. We have a large data set of available resources in the US to aid in helping those experiencing homelessness find local resources, community, and support.
6
7This private (_but public to read_) API is used in our [ChatGPT Assistant, Homeless Services](https://chatg.pt/homeless-help).
8
9## Why a [ChatGPT Assistant](https://chatg.pt/homeless-help)?
15- The data set has been compiled together over the years and will continue to be updated as new techniques and partnerships make that possible.
16- We use [Typesense](typesense.org), a search as a service tool, to provide lightning fast search results for homeless resources near you.
17- This endpoint is created with [Hono](hono.dev) and is an incredibly easy way to create an API.
18
19## Contact OurTechnology