1import { postToBluesky } from "./blueskyPost";
2
3export default async function(interval: Interval) {
4 await postToBluesky();
5}
1import { BskyAgent } from "npm:@atproto/api";
2
3export async function postToBluesky() {
4 const agent = new BskyAgent({
5 service: "https://bsky.social",
7});
8
9// Example function to list Notion users
10export async function listNotionUsers() {
11 const listUsersResponse = await notion.users.list({});
12 return listUsersResponse;
3import { Eval } from "npm:braintrust";
4
5export default async function handler() {
6 const result = {
7 apiKeyStatus: null,
10const TABLE_NAME = `${KEY}_versions_v1`;
11
12async function fetchContent(url: string) {
13 const response = await fetch(url);
14 return await response.text();
15}
16
17async function initializeDatabase() {
18 await sqlite.execute(`
19 CREATE TABLE IF NOT EXISTS ${TABLE_NAME} (
26}
27
28export default async function(interval: Interval) {
29 await initializeDatabase();
30
56}
57
58async function sha256(message: string): Promise<string> {
59 const msgUint8 = new TextEncoder().encode(message);
60 const hashBuffer = await crypto.subtle.digest("SHA-256", msgUint8);
64}
65
66export async function getAllVersions() {
67 await initializeDatabase();
68 const versions = await sqlite.execute(`SELECT * FROM ${TABLE_NAME} ORDER BY timestamp DESC`);
1## Get Weather
2
3Simple function to get weather data from the free [wttr.in](https://wttr.in/:help) service.
4
5```ts
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export async function getWeather(location: string): Promise<WeatherResponse> {
4 return fetchJSON(`https://wttr.in/${location}?format=j1`);
5}
1import { getWeather } from "https://esm.town/v/stevekrouse/getWeather";
2
3export default async function(interval: Interval) {
4 let weather = await getWeather("Brooklyn, NY");
5 console.log(weather.current_condition[0].FeelsLikeF);
3import "swagger-ui-dist/swagger-ui.css";
4
5export default async function (req: Request): Promise<Response> {
6 const ui = SwaggerUI({
7 url: "https://petstore.swagger.io/v2/swagger.json",
1export default async function (req: Request): Promise<Response> {
2 return Response.json({ ok: true })
3}