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
75```
7677See the [URLPattern API](https://developer.mozilla.org/en-US/docs/Web/API/URL_Pattern_API) for reference.
7879## Logout
spotifyAPImain.tsx2 matches
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
23export let spotifyAPI = ({token, endpoint, ...params}) => fetchJSON(
4`https://api.spotify.com/v1/${endpoint}?${new URLSearchParams(params)}`,
5{
6headers: { Authorization: `Bearer ${token}` },
45async function createScreenshot(code: string) {
6const apiUrl = "https://sourcecodeshots.com/api/image";
7const resp = await fetch(apiUrl, {
8method: "POST",
9headers: {
39}
40}
41const resp = await fetch(`https://api.val.town/v1/alias/${author}/${name}`, {
42headers,
43});
50const version = url.searchParams.get("v");
51const resp = await fetch(
52`https://api.val.town/v1/vals/${val.id}/versions/${version}`,
53{ headers },
54);
cors_proxyREADME.md1 match
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' \
milligramCssmain.tsx1 match
910export 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",
memoryApiPolicymain.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
companiesHousePublicDatamain.tsx4 matches
2const url = new URL(req.url);
3const path = url.searchParams.get("path");
4const apiUrl = new URL(path, "https://api.company-information.service.gov.uk/");
5const apiKey = Deno.env.get("companiesHouseApiKey");
6const basicAuth = btoa(apiKey + ":");
7const response = await fetch(apiUrl, {
8headers: { Authorization: `Basic ${basicAuth}` },
9});
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=44";
2import { google } from "npm:googleapis";
34export async function getAccessToken(accountId: string, bearer = Deno.env.get("pipedream")) {
5const response = await fetchJSON(
6`https://api.pipedream.com/v1/accounts/${accountId}?include_credentials=1`,
7{ bearer },
8);
1# Pipedream helpers
23Pipedream 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).
45The 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:
67```ts
37```
3839In 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!
4041Migrated from folder: Archive/pipedream