9[](https://www.val.town/v/stevekrouse/blob_admin_app/fork)
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).
12
13# TODO
1import ky from "npm:ky";
2
3const prefixUrl = "https://public.api.bsky.app/xrpc/";
4
5// @see: https://docs.bsky.app/docs/api/com-atproto-identity-resolve-handle
6export function resolveHandle(handle: string) {
7 return ky.get("com.atproto.identity.resolveHandle", {
11}
12
13// @see: https://docs.bsky.app/docs/api/app-bsky-feed-get-post-thread
14export function getPostThread(uri: string) {
15 return ky.get("app.bsky.feed.getPostThread", {
15}
16
17// @see: https://github.com/vercel/react-tweet/blob/a292ca7/packages/react-tweet/src/api/fetch-tweet.ts#L27-L31
18function getToken(id: string) {
19 return ((Number(id) / 1e15) * Math.PI)
5## Usage
6
71. Set the environment variables for `YOUTUBE_API_KEY` and `YOUTUBE_CHANNEL_ID`
81. Fork this
91. Go
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3await fetchJSON("https://api.val.town/v1/vals", {
4 headers: {
5 Authorization: `Bearer ${Deno.env.get("valtown")}`,
148 font-size: 1rem;
149 font-family: var(--main-font);
150 text-transform: capitalize;
151 display: flex;
152 align-items: center;
1// https://api.val.town/v1/express/liamdanielduffy.reactTodoListWebsite
2export const REACT_TODO_LIST_CONTENTS = {
3 body: `<div id="root"></div>
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
3export function alias<P extends Params>(params: P): Promise<Result<P>> {
4 const username = params.username;
5 let url = `https://api.val.town/v1/alias/${username}`;
6 if ("valName" in params)
7 url = url + `/${params.valName}`;
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 ) {