Search

Results include substring matches and semantically similar vals. Learn more
zerovox avatar
readwiseReaderReadItemsRss
@zerovox
Creates an RSS feed of my read items from Readwise Reader. Reader docs here: https://readwise.io/reader_api In order to get read items from Readwise Reader -> Workflowy, this turns the read items (aka "archive") into an RSS feed, which Zapier picks up, and creates bullets in Workflowy. Ideally would store the generated RSS or the last fetch date, and only get new items, but for now readwiseReaderDocumentList re-fetches the full history each time.
HTTP
import { readwiseReaderDocumentList } from "https://esm.town/v/zerovox/readwiseReaderDocumentList";
export async function readwiseReaderReadItemsRss() {
// Get all of a user's archived documents
rssLink: "https://zerovox-readwisereaderreaditemsrss.web.val.run",
function escapeXml(unsafe) {
return unsafe.replace(/[<>&'"]/g, function(c) {
switch (c) {
vladimyr avatar
base256kitten
@vladimyr
// SPDX-License-Identifier: AGPL-3.0-or-later
Script
p[c.codePointAt(0) as number] = i;
return p;
export function encode(data: Uint8Array): string {
return data.reduce((p, c) => {
p += alphabetBytesToChars[c];
return p;
export function decode(str: string): Uint8Array {
const byts = [];
for (const char of str) {
dvdsgl avatar
effect
@dvdsgl
// Make a string like 3.1s or 123ms from a Duration
Script
? `${Duration.toSeconds(d).toFixed(1)}s`
: `${Duration.toMillis(d)}ms`;
export function withTimeLog<A, E, C>(
label: string,
): (self: Effect.Effect<A, E, C>) => Effect.Effect<A, E, C> {
return (self) =>
Effect.gen(function*() {
const start = yield* Clock.currentTimeMillis;
const result = yield* self;
vladimyr avatar
aspBadge
@vladimyr
ASP badge generator This is small SVG badge generator made for Ariadne.id Signature Profiles . Route format is: https://vladimyr-aspbadge.web.val.run/<aspe_uri> with optional format and debug query params. Use ?format=json to get back JSON response. JSON format can be used as an input for Shields.io's dynamic endpoint badge . Badge with legacy ASPE URI: [![](https://vladimyr-aspbadge.web.val.run/aspe:keyoxide.org:TOICV3SYXNJP7E4P5AOK5DHW44)](https://keyoxide.org/aspe:keyoxide.org:TOICV3SYXNJP7E4P5AOK5DHW44) ๐Ÿ”ฌ๏ธ inspect ASP JWT token Badge with new ASPE URI (not functional yet โš ๏ธ): [![](https://vladimyr-aspbadge.web.val.run/aspe:fe7b75c54b95ac019dd48fbefe8d654af383cbfe)](https://keyoxide.org/aspe:fe7b75c54b95ac019dd48fbefe8d654af383cbfe)
HTTP
[๐Ÿ”ฌ๏ธ inspect ASP JWT token](https://vladimyr-aspe_inspector.web.val.run/aspe:keyoxide.org:TOICV3SYXNJP7E4P5AOK5DHW44)
Badge with new ASPE URI (not functional yet โš ๏ธ):
[![](https://vladimyr-aspbadge.web.val.run/aspe:fe7b75c54b95ac019dd48fbefe8d654af383cbfe)](https://keyoxide.org/aspe:fe7b75c5
const BADGE_COLOR = "6855c3";
export default async function(req: Request): Promise<Response> {
const reqURL = new URL(req.url);
"content-type": "image/svg+xml",
async function getBadgeConfig(aspeUri: string, debug = false): Promise<BadgeConfig> {
const config: BadgeConfig = {
return config;
async function processAspeUri(aspeUri: string) {
let aspeURI: AspeURI | LegacyAspeURI = parseAspeURI(aspeUri);
triptych avatar
hitCounter
@triptych
Create a simple hit counter that you can attach to any website via fetch . I created a web component to use this : export class HitCounter extends HTMLElement { constructor() { super(); this.attachShadow({ mode: 'open' }); this.count = 0; this.fetchCount(); } fetchCount() { fetch('https://triptych-hitcounter.web.val.run/') .then(response => response.json()) .then(data => { this.count = data.siteCount; this.render(); }) .catch(error => console.error('Error fetching count:', error)); } render() { const container = document.createElement('div'); container.style.backgroundColor = 'black'; container.style.color = 'white'; container.style.border = '1px solid white'; container.style.padding = '10px'; container.style.display = 'inline-block'; // Add this line container.textContent = `hit count: ${this.count}`; this.shadowRoot.appendChild(container); } } customElements.define('hit-counter', HitCounter);
HTTP
await blob.setJSON(KEY, oldState + 1);
const siteCount = await blob.getJSON(KEY);
export default async function(req: Request): Promise<Response> {
return Response.json({ siteCount });
rodrigotello avatar
generateColor
@rodrigotello
An interactive, runnable TypeScript val by rodrigotello
Script
import { convertRGBToHex } from "https://esm.town/v/rodrigotello/convertRGBToHex";
export function generateColor(cssColorObject) {
return `#${
Object.values(cssColorObject)
petermillspaugh avatar
dailySubscriptionStats
@petermillspaugh
Val Town email subscriptions: daily stats Cousin Val to @petermillspaugh/emailSubscription for emailing yourself daily subscriber stats.
Cron
verified: 0 | 1,
totalSubs: number,
export async function dailyEmailSubscriptionStats(interval: Interval) {
const { rows: newSubs } = await sqlite.execute(`
SELECT name, email
xkonti avatar
computeSchedule
@xkonti
computeSchedule function Combines several schedule segments together to form a complete schedule for a 24-hour period. Parameters: scheduleSegments - An array of ScheduleSegment objects describing the daily loop. Returns: An array of TimeSpan objects representing the complete schedule for the device. TimeSpan type Represents a span of time with a starting point and a duration in minutes. DutyCycle type Represents the "on" state scheduling pattern for a device. It's similar to the concept of Pulse-Width Modulation (PWM). ScheduleSegment type A part of a complete schedule, describing a time frame with a specified duty cycle.
Script
# `computeSchedule` function
Combines several schedule segments together to form a complete schedule for a 24-hour period.
iamseeley avatar
validateHTMLandCSS
@iamseeley
An interactive, runnable TypeScript val by iamseeley
Script
column: number;
function validateHTML(html: string): ValidationResult {
const errors: ValidationResult['errors'] = [];
return { isValid: errors.length === 0, errors };
function validateCSS(css: string): ValidationResult {
const errors: ValidationResult['errors'] = [];
return { isValid: errors.length === 0, errors };
export function validateHTMLAndCSS(code: string): ValidationResult {
const htmlErrors = validateHTML(code);
yieldray avatar
uuid
@yieldray
UUID Get an uuid via http GET call
Express (deprecated)
export async function uuid(req: express.Request, res: express.Response) {
res.set({
"Access-Control-Allow-Origin": "*",
samk avatar
btcPriceAlert
@samk
BTC Price Alert This val monitors the price of Bitcoin (BTC) and sends an email alert if the price fluctuates significantly. Specifically, it checks the current BTC price against the last recorded price and triggers an email notification if the change exceeds 20%. The email includes the new price, formatted as currency. Fork this val to get these notifications on your inbox.
Cron
import { email } from "https://esm.town/v/std/email?v=9";
import { currency } from "https://esm.town/v/stevekrouse/currency";
export async function btcPriceAlert() {
const lastBtcPrice: number = await blob.getJSON("lastBtcPrice");
let btcPrice = await currency("usd", "eth");
trob avatar
cardSortDragDropApp
@trob
@jsxImportSource https://esm.sh/react
HTTP
return this.props.children;
function App() {
console.log("Rendering App component");
</div>
function client() {
try {
if (typeof document !== "undefined") { setTimeout(client, 0); }
export default async function server(request: Request): Promise<Response> {
const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
<div id="root"></div>
<script>window.onerror = function(message, source, lineno, colno, error) { console.error("Global error:", message,
<script src="https://esm.town/v/std/catch"></script>
twschiller avatar
communityBoatingFlag
@twschiller
Fetch the sailing flag color from https://www.community-boating.org/
Script
import { fetch } from "https://esm.town/v/std/fetch";
export async function communityBoatingFlag() {
const response = await fetch("https://api.community-boating.org/api/flag");
const text = await response.text();
agmm avatar
sslCertificates
@agmm
What is this for? To get a list of all the SSL certificates that have been issued for a particular domain. Usage import { getCertificates } from "https://esm.town/v/agmm/sslCertificates"; const results = await getCertificates("agmm.xyz"); console.log(results)
Script
serial_number: string;
result_count: number;
export async function getCertificates(domain: string) {
const url = `https://crt.sh/json?q=${domain}`;
const response = await fetch(url);
stevekrouse avatar
blob_delete_by_prefix
@stevekrouse
Delete blobs by prefix Utility to delete your blobs by prefix
Script
import { blob } from "https://esm.town/v/std/blob?v=11";
export async function deleteBlobs(prefix: string) {
(await blob.list(prefix)).forEach(({ key }) => blob.delete(key));
โ€ฆ
440
โ€ฆ
Next