16 // like the sender and the message text
17 const result = await fetchJSON(
18 "https://slack.com/api/chat.postMessage",
19 {
20 headers: {
4 // Verify this webhook came from our bot
5 if (
6 req.headers.get("x-telegram-bot-api-secret-token")
7 !== Deno.env.get("telegramWebhookSecret")
8 ) {
25 <meta charset="UTF-8" />
26 <meta name="viewport" content="width=device-width, initial-scale=1.0" />
27 <link rel="preconnect" href="https://fonts.googleapis.com">
28<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
29<link href="https://fonts.googleapis.com/css2?family=Source+Sans+3:ital,wght@0,200..900;1,200..900&display=swap" rel="stylesheet">
30 <title>${title}</title>
31 <style>
1# Reload in new tabs when your vals change
2
3When you're working on an HTML HTTP val in a new tab, it's annoying to have to manually reload the tab on every save. In the Val Town editor, you can hit cmd+enter, but there's nothing like that for a val in a new tab because Val Town doesn't control that new tab (like we control the iframe in the browser preview). However, you control that HTML via the fetch handler you're writing, so you can add a script that polls the Val Town API for the current version number of your val, and reload itself if it detects a new version. This val has a collection of helpers to help you do just that.
4
5## Usage
1null
2
3Migrated from folder: Archive/vtOpenAPI
1null
2
3Migrated from folder: Web_API/jsonBodyParsing
1# Submit a PR from Val Town
2
3This val provides a (very) thin wrapper around the GH rest API methods for creating a pull request. It handles the creation of a Octokit client for you.
4
5## Usage
20## Parameters
21
22The function takes two parameters: your gh access token and an object that's identical to the object submitted to the gh API. See [GH's documentation](https://docs.github.com/en/rest/pulls/pulls?apiVersion=2022-11-28#create-a-pull-request) for more info!
23
24
3
4/**
5 * This requires a free API token from browserless.io saved in your
6 * Env Variables as BROWSERLESS_API_KEY
7 */
8let sendPDF = async (subject, html) => {
9 const browserlessApi = Deno.env.get("BROWSERLESS_API_KEY");
10 const browser = await puppeteer.connect({
11 browserWSEndpoint: `wss://chrome.browserless.io?token=${browserlessApi}`,
12 });
13 const page = await browser.newPage();
2
3export default async () => {
4 const browserlessApi = Deno.env.get("BROWSERLESS_API_KEY");
5 const browser = await puppeteer.connect({
6 browserWSEndpoint: `wss://chrome.browserless.io?token=${browserlessApi}`,
7 });
8 const page = await browser.newPage();
1/** @jsxImportSource https://esm.sh/hono@3.9.2/jsx **/
2
3import { Homepage } from "https://esm.town/v/nbbaier/dbToAPIFrontend";
4import { checkResource, getResources, type Options, validate } from "https://esm.town/v/nbbaier/dbToApiHelpers";
5import { Hono } from "npm:hono";
6