316 <meta name="viewport" content="width=device-width, initial-scale=1.0">
317 <title>Tomaso Valmax: Token Breathing Master</title>
318 <link href="https://fonts.googleapis.com/css2?family=Merriweather:wght@400;700&family=Lora:wght@400;700&display=swap" rel="stylesheet">
319 <style>${css}</style>
320 </head>
4 * This is a simple script to create a post on Campsite. Use it as a starting point for other scripts.
5 *
6 * Campsite API Documentation: https://campsite.com/docs
7 */
8
17 };
18
19 const response = await fetch("https://api.campsite.com/v2/posts", {
20 method: "POST",
21 headers: {
22 "Content-Type": "application/json",
23 Authorization: `Bearer ${Deno.env.get("CAMPBOT_API_KEY")}`,
24 },
25 body: JSON.stringify(body),
8 * 1. Fork this val
9 * 2. Create a custom integration in your Campsite organization settings [1]
10 * 3. Add the API token as an environment variable named `CAMPSITE_API_TOKEN` in Val Town
11 * 4. Add the project ID where you want to create alerts as `PR_ALERTS_PROJECT_ID`
12 * 5. Copy the HTTP endpoint for this Val and add it as a webhook in your GitHub settings [2]
16 * [2] https://github.com/<username>/<repo>/settings/hooks
17 *
18 * Campsite API docs:
19 * https://campsite.com/docs
20 */
22
23// These environment variables are required:
24const CAMPSITE_API_KEY = Deno.env.get("CAMPSITE_API_KEY");
25
26// Set these to your own values:
32 }
33
34 const campsite = new Campsite({ apiKey: CAMPSITE_API_KEY });
35
36 try {
6
7// Required environment variables
8const CAMPSITE_API_KEY = Deno.env.get("CAMPSITE_EMAILS_API_KEY");
9const CAMPSITE_CHANNEL_ID = "<your-channel-id>";
10
15// Other providers are available via Vercel's AI SDK:
16// https://sdk.vercel.ai/docs/introduction#model-providers
17const OPENAI_API_KEY = Deno.env.get("OPENAI_API_KEY");
18
19const campsite = new Campsite({ apiKey: CAMPSITE_API_KEY });
20
21export async function emailValHandler(payload: Email) {
29 let subject = payload.subject || "Forwarded email (no subject)";
30
31 if (OPENAI_API_KEY) {
32 const openai = createOpenAI({ apiKey: OPENAI_API_KEY });
33
34 // Extract name and email from the forwarded message
7 * https://www.campsite.com/blog/effective-daily-standups-for-distributed-teams
8 *
9 * Campsite API docs:
10 * https://campsite.com/docs
11 */
13
14// These environment variables are required:
15const CAMPSITE_API_KEY = Deno.env.get("CAMPBOT_API_KEY");
16
17// Set these to your own values:
37 });
38
39 const campsite = new Campsite({ apiKey: CAMPSITE_API_KEY });
40
41 await campsite.posts.create({
7 * [1] https://axiom.co
8 *
9 * Campsite API docs:
10 * https://campsite.com/docs
11 */
12
13// These environment variables are required:
14const CAMPSITE_API_KEY = Deno.env.get("CAMPSITE_API_KEY");
15
16// Set these to your own values:
40
41 const campsiteResponse = await fetch(
42 `https://api.campsite.com/v2/threads/${CAMPSITE_ALERTS_THREAD_ID}/messages`,
43 {
44 method: "POST",
45 headers: {
46 "Content-Type": "application/json",
47 Authorization: `Bearer ${CAMPSITE_API_KEY}`,
48 },
49 body: JSON.stringify({
54
55 if (!campsiteResponse.ok) {
56 throw new Error(`Campsite API error: ${campsiteResponse.statusText}`);
57 }
58
114 <title>Course Content Viewer</title>
115 <meta name="viewport" content="width=device-width, initial-scale=1">
116 <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;700&display=swap" rel="stylesheet">
117 <style>${css}</style>
118 </head>
11[](https://www.val.town/v/stevekrouse/blob_admin_app/fork)
12
13It 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).
14
15# TODO
1Code from https://deno.com/blog/build-image-resizing-api
2
3Useful for compressing an image before sending to chatgpt4v, for example
6- **Analogue Clock Schedule:** Displays daily activities in an analogue clock format with segments representing different time slots.
7- **Chore Tracker:** Lists chores for the day, with checkboxes for completion tracking.
8- **Customizable:** Accepts schedule and todoList props, allowing dynamic data from APIs or other sources.
9- **Real-time Updates:** The clock updates every second to show the current time.
10- **Responsive Design:** Styled with Tailwind CSS for a modern and clean appearance.