Search

getAvailableCourses
@usefulthink
An interactive, runnable TypeScript val by usefulthink
Script
import { fetch } from "https://esm.town/v/std/fetch";
import { parseBlock } from "https://esm.town/v/usefulthink/parseBlock";
export async function getAvailableCourses() {
const JSDOM = await import("npm:jsdom");
const qs = await import("node:querystring");
valle_tmp_205216506430841331121632259852896
@janpaul123
// Response with "Hello World" in fancy HTML with silly gradients on every HTTP request
HTTP
// Response with "Hello World" in fancy HTML with silly gradients on every HTTP request
export default async function(req: Request): Promise<Response> {
const html = `
<!DOCTYPE html>
vibrantBronzeAnt
@faroutroy
@jsxImportSource https://esm.sh/react@18.2.0
HTTP
import React, { useState } from "https://esm.sh/react@18.2.0";
function App() {
const [file, setFile] = useState(null);
</div>
function client() {
createRoot(document.getElementById("root")).render(<App />);
if (typeof document !== "undefined") { client(); }
export default async function server(request: Request): Promise<Response> {
if (request.method === "POST" && new URL(request.url).pathname === "/analyze") {
const { OpenAI } = await import("https://esm.town/v/std/openai");
const openai = new OpenAI();
try {
const limitedData = jsonData.slice(0, 50);
// Use OpenAI for intelligent analysis with more specific instructions
const analysisPrompt = `Provide a concise data analysis and forecasting insights:
Dataset preview: ${JSON.stringify(limitedData.slice(0, 5))}`;
const completion = await openai.chat.completions.create({
messages: [{ role: "user", content: analysisPrompt }],

getMcgillEvents
@ehodges
An interactive, runnable TypeScript val by ehodges
Script
import { msDay } from "https://esm.town/v/stevekrouse/msDay?v=1";
import { newRSSItems } from "https://esm.town/v/stevekrouse/newRSSItems?v=6";
export async function getMcgillEvents() {
const url =
"https://www.alumni.mcgill.ca/aoc/events-travel/registration/regwizEventsList.php?location=050%3AMA&school=&dateMonth=&title=&doSearch=1";

examplePreactWebApp
@easrng
@easrng.preactWebApp example
Express (deprecated)
import { preactWebApp } from "https://esm.town/v/easrng/preactWebApp";
export const examplePreactWebApp = preactWebApp(
function App(
{ html, req, ...rest }: typeof preactWebApp.props,
const KeyList = ({ obj, maxDepth = 3 }) =>
sittingTrackerAlert
@olivas20000
@jsxImportSource https://esm.sh/react@18.2.0
Cron
import React, { useState } from "https://esm.sh/react@18.2.0";
function App() {
const [name, setName] = useState("");
</div>
function client() {
createRoot(document.getElementById("root")).render(<App />);
if (typeof document !== "undefined") { client(); }
export default async function server(request: Request): Promise<Response> {
const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
aqi
@unicorn
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
import { email } from "https://esm.town/v/std/email?v=9";
import { easyAQI } from "https://esm.town/v/stevekrouse/easyAQI?v=5";
export async function aqi(interval: Interval) {
const location = "ZΓΌrich, Schweiz"; // <-- change to place, city, or zip code
const data = await easyAQI({ location });
actuallyItsXBot
@andreterron
Actually, It's π An annoying bot that corrects people about the new name of the app previously known as Twitter. Follow it on π ! The Twitter β π transition is pretty painful, and this bot is here to make things even worse! Want to create your own bot? Check out https://www.val.town/v/andreterron.twitter
Script
import { searchPostsForTheActuallyBot } from "https://esm.town/v/andreterron/searchPostsForTheActuallyBot";
import { refreshActuallyBotToken } from "https://esm.town/v/andreterron/refreshActuallyBotToken";
export async function actuallyItsXBot() {
const token = await refreshActuallyBotToken();
// Search

coralMule
@pomdtr
An interactive, runnable TypeScript val by pomdtr
HTTP
export default async function (req: Request): Promise<Response> {
return Response.json({ ok: true })

todo
@pomdtr
All TODOs from public vals Todo [ ] Remove forks from results ? [ ] use a cron val to cache results in an sqlite table
HTTP
import { gfm } from "https://esm.town/v/pomdtr/gfm";
import { html } from "https://esm.town/v/stevekrouse/html?v=5";
async function handler(req: Request) {
const { data: vals } = await api(`/v1/search/vals?query=${encodeURIComponent("- [ ]")}`);
let markdown = "# Todos\n";
weatherTomorrowGpt3
@patrickjm
An interactive, runnable TypeScript val by patrickjm
Script
import { gpt3 } from "https://esm.town/v/patrickjm/gpt3";
import { simpleWeather } from "https://esm.town/v/patrickjm/simpleWeather";
export let weatherTomorrowGpt3 = (params: { openAiKey: string, city: string }) =>
simpleWeather(params.city).then((weather) =>
gpt3({
openAiKey: params.openAiKey,
prompt: `
Given a JSON sequence, give a short, plain-English summary about the weather tomorrow.

time
@stevekrouse
An interactive, runnable TypeScript val by stevekrouse
Script
export async function time(f: Function): Promise<[
any,
number,
NeloDigitalApp
@Agbo
@jsxImportSource https://esm.sh/react@18.2.0
HTTP
import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
function App() {
const [view, setView] = useState('home');
</div>
function HomePage({ onRegisterClick, onReferralClick }) {
return (
</div>
function RegisterForm({ onRegister }) {
const [formData, setFormData] = useState({
</form>
function Dashboard({ user, onPurchase, onGenerateEpin }) {
const [balance, setBalance] = useState(0);
</div>
function PurchaseOptions({ user }) {
const services = [
</div>
function EpinGenerator({ user }) {
const [epinDetails, setEpinDetails] = useState({
textDecoration: 'none'
function client() {
createRoot(document.getElementById("root")).render(<App />);
if (typeof document !== "undefined") { client(); }
export default async function server(request: Request): Promise<Response> {
const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");

valtowntown
@vawogbemi
ποΈ Val Town Town Val Town implemented in Val Town. What if you want to build your own Val Town? What if you want features we haven't built yet? Val Town Town demonstrates how you can run untrusted code yourself. Extend it and see what you can build!
HTTP
await contentStore.init();
function Town() {
return (
</div>
function HomePage() {
return (
<textarea name="handler" rows={10} cols={50} autoFocus>
{`export default async function(req: Request) {
return Response.json("Hello, world!");
</html>
function ContentPage({ handler, id }: { handler: string; id: string }) {
return (
let originalContent = textarea.value;
textarea.addEventListener('input', function() {
if (textarea.value !== originalContent) {
PBKDF2_Generator
@rozek
This is a simple generator for PBKDF2 password hashes. It can be used to manually generate these hashes and store it in a password file if no other mechanism for doing so is available. There is no specific required format for the password. For the number of iterations, values from 100000 up to 999999 are accepted - in these days, values of 600000 or higher are recommended. The final output has the format "{PBKDF2}<iterations>$<salt>$<hash>" where salt and hash are Base64-encoded. You may copy it directly or use salt and hash separately if you need a different format. The applet uses WebCrypto and runs entirely within the browser.
HTTP
const TrackingTable = 'PBKDF2_Generator'
const Granularity = 15*60*1000
export default async function (Request:Request):Promise<Response> {
if (Request.method !== 'GET') {
return new Response('Method Not Allowed', { status:405 })