Search

Results include substring matches and semantically similar vals. Learn more
csl_ avatar
AdmiralCloudbergChecker
@csl_
I just wanna get an email when Admiral Cloudberg posts one of her essays, what can I say
Cron
I just wanna get an email when Admiral Cloudberg posts one of her essays, what can I say
// This cronjob runs daily to check for new posts on Admiral Cloudberg's Medium page
// and sends an email notification if a new post is found.
// It uses the RSS feed of the Medium page to check for updates.
export default async function notify() {
try {
// Fetch and parse the RSS feed
const rss = await Parse.parse("https://medium.com/feed/@admiralcloudberg");
// Get the latest post
const latestPost = rss.items[0];
maxm avatar
niceTodoList
@maxm
* This is a minimalist to-do list app using server-side rendering without any client-side JavaScript. * It uses Val Town's SQLite for data persistence, Deno's standard library for HTML escaping, * and custom SVG icons for a cohesive design.
HTTP
* This is a minimalist to-do list app using server-side rendering without any client-side JavaScript.
* It uses Val Town's SQLite for data persistence, Deno's standard library for HTML escaping,
* and custom SVG icons for a cohesive design.
// Server-side only code
export default async function server(request: Request): Promise<Response> {
const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
const SCHEMA_VERSION = 1
const KEY = new URL(import.meta.url).pathname.split("/").at(-1);
// Create the todos table if it doesn't exist
await sqlite.execute(`
easrng avatar
signInWithValTownDemo
@easrng
@easrng/signInWithValTown Demo An example of how to add authentication backed by val.town accounts to a val.
HTTP (deprecated)
# @easrng/signInWithValTown Demo
An example of how to add authentication backed by val.town accounts to a val.
[![Open](https://easrng-button.express.val.run/Open)](https://easrng-signInWithValTownDemo.web.val.run)
/** @jsx jsx */
/** @jsxFrag Fragment */
createContext,
type FC,
Fragment,
jsx,
type PropsWithChildren,
easrng avatar
dumbingOfAgeServerTime
@easrng
An interactive, runnable TypeScript val by easrng
Script
export const dumbingOfAgeServerTime = async () => {
const before = Date.now();
const serverTs = new Date(
(await fetch(
"https://www.dumbingofage.com/wp-content/uploads/css/custom_style.css?v=" +
Date.now()
)).headers.get("date"),
).valueOf();
const after = Date.now();
const offset = serverTs - (before + after) / 2;
rodrigotello avatar
loremipsum256
@rodrigotello
An interactive, runnable TypeScript val by rodrigotello
Script
import { loremipsum } from "https://esm.town/v/rodrigotello/loremipsum";
export let loremipsum256 = loremipsum.substring(0, 256);
natashatherobot avatar
UPDATED UPDATED UPDATED UPDATED MyUpdatedVal
@natashatherobot
An interactive, runnable TypeScript val by natashatherobot
Script
const two = 1 + 1;
console.log(two);
amoeba avatar
aqi
@amoeba
AQI Alerts Get email alerts when AQI is unhealthy near you. Set up Click Fork Change location (Line 4) to describe your location. It accepts fairly flexible English descriptions which it turns into locations via nominatim's geocoder API . Click Run Background This val uses nominatim's geocoder to get your lat, lon, and air quality data from OpenAQ. It uses EPA's NowCast AQI Index calculation and severity levels. Learn more: https://www.val.town/v/stevekrouse.easyAQI
Cron
# AQI Alerts
Get email alerts when AQI is unhealthy near you.
![](https://i.imgur.com/hB56X7o.png)
## Set up
1. Click `Fork`
2. Change `location` (Line 4) to describe your location. It accepts fairly flexible English descriptions which it turns into
export async function aqi(interval: Interval) {
const location = "seattle, wa"; // <-- change to place, city, or zip code
const data = await easyAQI({ location });
if (!interval.lastRunAt) {
gueejla avatar
weather
@gueejla
Trying out val town functionality, code from https://docs.val.town/quickstarts/first-cron/
Cron
Trying out val town functionality, code from https://docs.val.town/quickstarts/first-cron/
import { getWeather } from "https://esm.town/v/stevekrouse/getWeather";
export default async function(interval: Interval) {
let weather = await getWeather("Chicago, IL");
let howItFeelin = weather.current_condition[0].FeelsLikeF;
let chanceOfMeatball = weather.current_condition[0].weatherDesc[0].value;
await email({
subject: `Weather is something like ${chanceOfMeatball} and ${howItFeelin}° I guess シ`,
juliendorra avatar
geolocation
@juliendorra
An interactive, runnable TypeScript val by juliendorra
Script
export let geolocation = async (req, res) => {
const ip = req.options.headers["x-forwarded-for"];
const jsonresponse = await $stevekrouse.fetchJSON(
`http://ip-api.com/json/${ip}`
res.json({ ip: req });
parkerdavis avatar
linksForm
@parkerdavis
An interactive, runnable TypeScript val by parkerdavis
HTTP (deprecated)
export let linksForm = async (req: Request) => {
if (req.method === "POST") {
let formData = await req.formData();
let data = {
email: formData.get("email"),
message: formData.get("message"),
time: Date.now(),
await email2({
text: data,
subject: "Links form submission received!",
akkartik avatar
oldHNFollowNotebook
@akkartik
An interactive, runnable TypeScript val by akkartik
Script
export let oldHNFollowNotebook = [
"@akkartik.hnInterval",
"@akkartik.testHNEmail",
"@akkartik.hnAlert",
"@akkartik.testHNAlert",
"@akkartik.getNewHNPosts",
"@akkartik.postprocessHNitem",
"@stevekrouse.hnSearch",
sircitrus avatar
email
@sircitrus
An interactive, runnable TypeScript val by sircitrus
Script
export let email = async (feedback: any) => {
(console.email as any)(feedback, "New feedback for Commonplace");
vez avatar
test_val_multiple_exports
@vez
An interactive, runnable TypeScript val by vez
Script
import { val } from "https://esm.town/v/todepond/val";
console.log(await val("vez.example", 3, 2));
dodobird avatar
guid
@dodobird
An interactive, runnable TypeScript val by dodobird
Script
export let guid = () => {
return (((1 + Math.random()) * 0x100000000) | 0).toString(16).substring(1);
neverstew avatar
deleteValVersionExample
@neverstew
An interactive, runnable TypeScript val by neverstew
Script
import { deleteValVersion } from "https://esm.town/v/neverstew/deleteValVersion";
export let deleteValVersionExample = deleteValVersion({
token: process.env.valtownToken,
id: "543ae134-636f-43a7-bd7f-f766a3d52b47",
version: 1,