harlequinEmuREADME.md1 match
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.
45
67## Install
salmonCrabREADME.md1 match
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.
45
67## Install
getOpengraphMetadatamain.tsx17 matches
1617// Get the data we want and send
18let imgUrl = getImageUrl(frag, url);
19let imgData = await getImageDataFromUrl(imgUrl);
20let title = getTitle(frag);
21let description = getDescription(frag);
23}
2425function getImageUrl(frag, url) {
26let imgUrl = "";
27let selectors = [
28"meta[property=\"og:image:secure_url\"]",
29"meta[property=\"og:image:url\"]",
30"meta[property=\"og:image\"]",
31"meta[name=\"twitter:image:src\"]",
32"meta[property=\"twitter:image:src\"]",
33"meta[name=\"twitter:image\"]",
34"meta[property=\"twitter:image\"]",
35"meta[itemprop=\"image\"]",
36];
37// Get image from the HTML fragment
38let element;
39for (let i = 0; i < selectors.length; i++) {
44}
4546// Still not present? Try to get the image of the author and use it instead
47element = frag.querySelector("img[alt*=\"author\" i]");
48if (!imgUrl && element && element.src) {
50}
5152// Still not present? Well let's take ANY visible image from the page.
53// You leave me no choice, my friend.
54element = frag.querySelector("img[src]:not([aria-hidden=\"true\"])");
65}
6667async function getImageDataFromUrl(url) {
68const response = await fetch(url);
69const base64data = Buffer.from(await response.arrayBuffer()).toString("base64");
70return "data:image/png;base64," + base64data;
71}
7280];
8182// Get image from the HTML fragment
83for (let i = 0; i < selectors.length; i++) {
84element = frag.querySelector(selectors[i]);
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.
45
67## Install
codeOnValTownREADME.md1 match
1# Code on Val Town
23
45Adds a "Code on Val Town" ribbon to your page. This lets your website visitors navigate to the code behind it.
leaderboardmain.tsx2 matches
10const table = stripAnsi(renderTable(zip(res)));
1112const resp = await fetch("https://sourcecodeshots.com/api/image", {
13method: "POST",
14headers: {
24return new Response(resp.body, {
25headers: {
26"Content-Type": "image/png",
27"Cache-Control": "fsjkdfdsjkj"
28},
12content: body.data.email_addresses[0].email_address
13+ " "
14+ body.data.profile_image_url,
15});
16return new Response("Success");
67Here's an example email from this Val:
8
910Every time you run it, you'll get a different feature. By default, this uses the `lg-v6` model, which I think is a good one to start with, but this may change in the future as I train better feature dictionaries!
1# Favicons
23
45```html
6<link
7rel="icon"
8href="https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/e8532b85-8de0-40f5-47a1-d4b9580ff200/public"
9media="(prefers-color-scheme: light)"
10/>
13----
1415
1617```html
18<link
19rel="icon"
20href="https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/f774eb95-7207-43bf-3a6b-a9a423d9bb00/public"
21media="(prefers-color-scheme: dark)"
22/>