1# ☔️ Umbrella reminder if there's rain today
2
3
4
5## Setup
147 padding: 0;
148 background-color: var(--background-color);
149 background-image: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
150 min-height: 100vh;
151}
23 height: 70vh;
24 border: 2px solid;
25 border-image: linear-gradient(45deg, #ff1b6b, #45caff) 1;
26 position: relative;
27 box-shadow: 0 0 20px #ff1b6b, inset 0 0 20px #45caff;
134 width: 100%;
135 height: 100%;
136 background-image: linear-gradient(0deg, transparent 24%,
137 rgba(69, 202, 255, .05) 25%,
138 rgba(69, 202, 255, .05) 26%, transparent 27%, transparent 74%,
23 height: 70vh;
24 border: 2px solid;
25 border-image: linear-gradient(45deg, #ff1b6b, #45caff) 1;
26 position: relative;
27 box-shadow: 0 0 20px #ff1b6b, inset 0 0 20px #45caff;
138 width: 100%;
139 height: 100%;
140 background-image: linear-gradient(0deg, transparent 24%,
141 rgba(69, 202, 255, .05) 25%,
142 rgba(69, 202, 255, .05) 26%, transparent 27%, transparent 74%,
23 height: 70vh;
24 border: 2px solid;
25 border-image: linear-gradient(45deg, #ff1b6b, #45caff) 1;
26 position: relative;
27 box-shadow: 0 0 20px #ff1b6b, inset 0 0 20px #45caff;
115 width: 100%;
116 height: 100%;
117 background-image:
118 linear-gradient(rgba(69, 202, 255, 0.1) 1px, transparent 1px),
119 linear-gradient(90deg, rgba(69, 202, 255, 0.1) 1px, transparent 1px);
23 height: 70vh;
24 border: 2px solid;
25 border-image: linear-gradient(45deg, #ff1b6b, #45caff) 1;
26 position: relative;
27 box-shadow: 0 0 20px #ff1b6b, inset 0 0 20px #45caff;
23 height: 70vh;
24 border: 2px solid;
25 border-image: linear-gradient(45deg, #ff1b6b, #45caff) 1;
26 position: relative;
27 box-shadow: 0 0 20px #ff1b6b, inset 0 0 20px #45caff;
3View and interact with your Val Town SQLite data. It's based off Steve's excellent [SQLite Admin](https://www.val.town/v/stevekrouse/sqlite_admin?v=46) val, adding the ability to run SQLite queries directly in the interface. This new version has a revised UI and that's heavily inspired by [LibSQL Studio](https://github.com/invisal/libsql-studio) by [invisal](https://github.com/invisal). This is now more an SPA, with tables, queries and results showing up on the same page.
4
5
6
7## Install
75 width: 100%;
76 height: 100%;
77 background: url('https://images.unsplash.com/photo-1506318137071-a8e063b4bec0?auto=format&fit=crop&w=1950&q=80') center/cover;
78 opacity: 0.3;
79 z-index: -1;
11
12 try {
13 const imageUrl = await getMostPopularPinterestImage(query);
14 return new Response(JSON.stringify({ image: imageUrl }), {
15 headers: {
16 "Content-Type": "application/json",
26}
27
28async function getMostPopularPinterestImage(query: string): Promise<string> {
29 const searchUrl = `https://api.pinterest.com/v5/search/pins?query=${encodeURIComponent(query)}&page_size=50&sort_order=popularity`;
30 const response = await fetch(searchUrl, {
46 const mostPopularPin = sortedPins[0];
47
48 if (mostPopularPin.images) {
49 // Get the largest available image
50 const images = mostPopularPin.images;
51 const largestImage = images[images.length - 1];
52 return largestImage.url;
53 }
54 }
55
56 throw new Error("No popular image found");
57}