94 { word: "Toothbrush", french: "Brosse à dents", icon: "🪥" },
95 { word: "Soap", french: "Savon", icon: "🧼" },
96 { word: "Toiletpaper", french: "Papier toilette", icon: "🧻" },
97 { word: "Scissors", french: "Ciseaux", icon: "✂️" },
98 { word: "Knife", french: "Couteau", icon: "🔪" },
9To use it on your own Val Town SQLite database, [fork it](https://www.val.town/v/stevekrouse/sqlite_admin/fork) to your account.
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).
26async function fetchAndProcessData() {
27 const response = await fetch(
28 'https://api.npmjs.org/versions/xstate/last-week',
29 )
30 const data: NpmVersionsLastWeekResult = await response.json()
1const apiHost = "https://api.kinopio.club";
2
3const requestOptions = (options) => {
4 // let's set up the request
5 const apiKey = Deno.env.get("KINOPIO_API_KEY"); // add your API key to val.town through Settings → Env Variables
6 const headers = new Headers({
7 "Content-Type": "application/json",
8 "Cache-Control": "must-revalidate, no-store, no-cache, private",
9 "Authorization": apiKey,
10 });
11 return {
18const getSpaces = async () => {
19 const options = requestOptions({ method: "GET" });
20 const response = await fetch(`${apiHost}/user/spaces`, options);
21 const data = await response.json();
22 const spaceNames = data.map(space => space.name);
1# KINOPIO: GET User Spaces
2
3Using the [Kinopio API docs](https://help.kinopio.club/api) lets get a list of our spaces using the authenticated `GET /user/spaces` route
4
5(This will not include group spaces created by other members of groups that you're in.)
27export const telegramWebhookChatbot = async (req: Request) => {
28 if (
29 req.headers.get("x-telegram-bot-api-secret-token") !==
30 Deno.env.get("telegramWebhookSecret")
31 ) {
6* Fork this val to your own profile.
7* Make a folder for the temporary vals that get generated, take the ID from the URL, and put it in `tempValsParentFolderId`.
8* If you want to use OpenAI models you need to set the `OPENAI_API_KEY` [env var](https://www.val.town/settings/environment-variables).
9* If you want to use Anthropic models you need to set the `ANTHROPIC_API_KEY` [env var](https://www.val.town/settings/environment-variables).
10* Create a [Val Town API token](https://www.val.town/settings/api), open the browser preview of this val, and use the API token as the password to log in.
11
12<img width=500 src="https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/7077d1b5-1fa7-4a9b-4b93-f8d01d3e4f00/public"/>
3export const telegramGetMe = async (botToken: string) =>
4 fetchJSON(
5 `https://api.telegram.org/bot${botToken}/getMe`,
6 );
3export const telegramGetMe = async (botToken: string) =>
4 fetchJSON(
5 `https://api.telegram.org/bot${botToken}/getMe`,
6 );
76 .toString("base64");
77
78 const response = await fetch(`https://api.switch-bot.com/${path}`, {
79 headers: {
80 "Authorization": token,