84const getImageUrl = () => {
85// Priority order:
86// 1. Val's image_url from API if available
87// 2. moi.md imageUrl if available
88// 3. Return null to use color placeholder
64// Fetch both user profile data and moi config in parallel
65const [profileResponse, config] = await Promise.all([
66fetch(`/api/profile/${username}?page=${currentPage}`),
67fetchMoiConfig(`https://www.val.town/x/${username}/`)
68]);
valProfilePagemoiConfig.tsx1 match
117}
118
119// Fallback: Use Val Town profile pic API
120return `https://pic.val.run/${username}`;
121}
vtProjectSearchstyles.tsx4 matches
782}
783784.api-info {
785margin-top: 10px;
786}
787788.api-info summary {
789cursor: pointer;
790color: var(--primary-color);
792}
793794.api-docs {
795background-color: var(--code-bg);
796padding: 10px 15px;
801}
802803.api-docs code {
804display: inline-block;
805background-color: white;
vtProjectSearchcomponents.tsx8 matches
1063<link rel="icon" href="https://fav.farm/π" />
1064<meta name="viewport" content="width=device-width, initial-scale=1" />
1065<link rel="preconnect" href="https://fonts.googleapis.com" />
1066<link rel="preconnect" href="https://fonts.gstatic.com" crossOrigin="anonymous" />
1067<link
1068href="https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:ital,wght@0,100..700;1,100..700&display=swap"
1069rel="stylesheet"
1070/>
1080<a href="https://val.town" className="valtown-link" style={{ marginLeft: "auto" }}>Return to Val Town</a>
1081</h1>
1082<div className="api-info">
1083<details>
1084<summary>API Access</summary>
1085<div className="api-docs">
1086<p>
1087You can access search results via JSON API by adding <code>format=json</code> to your query:
1088</p>
1089{searchTerm
1241<div className="search-examples">
1242<a href="?q=fetch" className="example-link">fetch</a>
1243<a href="?q=api" className="example-link">api</a>
1244<a href="?q=database" className="example-link">database</a>
1245<a href="?q=image" className="example-link">image</a>
1396<div className="search-examples">
1397<a href="?q=fetch" className="example-link">fetch</a>
1398<a href="?q=api" className="example-link">api</a>
1399<a href="?q=database" className="example-link">database</a>
1400<a href="?q=image" className="example-link">image</a>
weatherDashboardmain.tsx1 match
11try {
12const response = await fetch(
13`https://api.open-meteo.com/v1/forecast?latitude=${location.latitude}&longitude=${location.longitude}¤t_weather=true&hourly=temperature_2m,relativehumidity_2m,windspeed_10m`
14);
15const data = await response.json();
vtProjectSearchweb.http.tsx1 match
1import { handler } from "./api.tsx";
2import { loadTypeaheadDataIntoMemory } from "./db.ts";
3
vtProjectSearchdeno.lock2 matches
363},
364"redirects": {
365"https://esm.town/v/std/API_URL": "https://esm.town/v/std/API_URL?v=5",
366"https://esm.town/v/stevekrouse/sqlite": "https://esm.town/v/stevekrouse/sqlite?v=13"
367},
368"remote": {
369"https://docs.val.town/pagefind/pagefind.js": "43ee232b23e27fa6b00d4f71f08a165d35a824947525989c7a051843e408e0c0",
370"https://esm.town/v/std/API_URL?v=5": "46109f905a50e32281d3ffbe7b9c8209a778290c5274d83d131fba2d26c4974d",
371"https://esm.town/v/stevekrouse/sqlite?v=13": "3b613197e9da35db335dc2726c062c61f9247439c10a0c64c118994e200ffa46"
372}
valsindex.html1 match
7<p>
8For when you want to link to a Val Town user's profile pic, but don't want
9to make an API call. <a
10href="https://www.val.town/x/stevekrouse/profile-pics"
11>View source</a>
1# AQI Alerts
23**Note: I recently updated the code for this to the OpenAQ v3 API and there might be bugs.**
45Get email alerts when AQI is unhealthy near you.
10111. Click `Remix`
122. Change `location` (Line 4 in [main.tsx](/main.tsx#L4)) to describe your location. It accepts fairly flexible English descriptions which it turns into locations via [nominatim's geocoder API](https://www.val.town/v/stevekrouse/nominatimSearch).
133. Click `Run`
14