3async function getWeather() {
4 const response = await fetch(
5 "https://api.open-meteo.com/v1/forecast?latitude=48.7758&longitude=9.1829¤t=temperature_2m,weathercode&daily=weathercode,temperature_2m_max,temperature_2m_min&timezone=Europe%2FBerlin"
6 );
7 return await response.json();
6
7// Replace with your actual access token and Mastodon instance URL
8const MASTODON_TOKEN = Deno.env.get("MASTODON_API_KEY");
9const MASTODON_URL = "https://mastodon.social";
10
130 formData.append("description", altText);
131
132 const uploadResponse = await fetch(`${MASTODON_URL}/api/v2/media`, {
133 method: "POST",
134 headers: {
149 const mediaId = await uploadImage(imageBuffer, altText);
150
151 const postResponse = await fetch(`${MASTODON_URL}/api/v1/statuses`, {
152 method: "POST",
153 headers: {
1import { BskyAgent, BlobRef, RichText } from 'npm:@atproto/api';
2
3export async function blueskyPostWithImage(statusText: string, imageBuffer: any, altText: string) {
5console.info("Launching browser...");
6
7// Use Deno.env to get the API key
8const apiKey = Deno.env.get("BROWSERBASE_API_KEY");
9if (!apiKey) {
10 console.error("BROWSERBASE_API_KEY environment variable is not set");
11 Deno.exit(1);
12}
14try {
15 const browser = await chromium.connectOverCDP(
16 `wss://connect.browserbase.com?apiKey=${apiKey}`,
17 );
18 console.info("Connected!");
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 { api } from "https://esm.town/v/pomdtr/api";
2
3type Module = {
19 // search appears in the readme. We'll filter all these out later.
20 const searchString = ` from "https://esm.town/v/${initialSlug}`;
21 const { data } = await api(`/v1/search/vals?query=${encodeURI(searchString)}&offset=0&limit=100`);
22
23 return data
24### TODO
25Some ideas for how to expand this site:
26* **show the upstream dependencies** - no public API for this yet, but could probably make it work with the search api
27* **search for vals** - let people search for vals right from here, using the search api and debouncing
28* **toggle graph complexity** - let people choose to see all dependencies or only valtown dependencies (thru the browser)
29* **cache graphs in DB** - we should be kind to valtown's API by caching graph data as exploring the
30graph involves a lot of calls. maybe only update it when the val version number changes?
31* **handle more module sources** - currently we only group npm, esm.sh, and valtown modules. we could add more or make
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
2
3const browser = await puppeteer.connect({
4 browserWSEndpoint: `wss://connect.browserbase.com?apiKey=${Deno.env.get("BROWSERBASE_API_KEY")}`,
5});
6
1// This val fetches recent tweets about @SnapAR or Lens Studio
2// Updated to use Social Data instead of Twitter API
3
4import { socialDataSearch } from "https://esm.town/v/stevekrouse/socialDataSearch";