Search
valle_tmp_1205944128668687835247208564817623
@janpaul123
// This val will respond with a fun HTML page with crazy fonts and gradients
HTTP
// This val will respond with a fun HTML page with crazy fonts and gradients
export default async function main(): Promise<Response> {
const htmlContent = `
<!DOCTYPE html>
sendTime
@ning
An interactive, runnable TypeScript val by ning
Script
export async function sendTime() {
console.email(": nice to see you!");

gitReleaseNotes
@stevekrouse
Github Release Notes from package.json Enter a raw github URL to a package.json, https://raw.githubusercontent.com/username/repo/branch/package.json and get a response of all release notes for all packages from current to latest. Roadmap [ ] GenAI summary [ ] Weekly cron email reports [ ] Other package managers like PyPi [ ] Formatting/styling [ ] Loading spinner
HTTP
// Function to fetch package info from NPM registry
async function fetchPackageInfo(packageName: string) {
// Function to extract GitHub repo URL from package info
function extractGitHubRepoUrl(packageInfo: any): string | null {
// Function to get the GitHub repository path (owner/repo) from the URL
function getGithubRepoPath(repoUrl: string): string | null {
async function getGithubReleases(repo: string): Promise<GithubRelease[]> {
function compareVersions(version1: string, version2: string): number {
async function getReleaseNotesBetweenVersions(repo: string, currentVersion: string): Promise<GithubRelease[]> {
async function checkNpmUpdates(packageJsonUrl: string): Promise<string> {
Attendence
@nirwan
@jsxImportSource https://esm.sh/react
HTTP
import { createRoot } from "https://esm.sh/react-dom/client";
function AttendanceApp() {
const [company, setCompany] = useState('');
</div>
function client() {
createRoot(document.getElementById("root")).render(<AttendanceApp />);
if (typeof document !== "undefined") { client(); }
export default async function server(request: Request): Promise<Response> {
// Import SQLite dynamically

emailRandomJoke
@jay
An interactive, runnable TypeScript val by jay
Script
import { fetch } from "https://esm.town/v/std/fetch";
export async function emailRandomJoke() {
async function fetchRandomJoke() {
const response = await fetch(
"https://official-joke-api.appspot.com/random_joke",

myApi
@domru
An interactive, runnable TypeScript val by domru
Script
export function myApi(name) {
return "hi " + name;

dateme_home
@stevekrouse
@jsxImportSource npm:hono@3/jsx
Script
import date_me_doc_locations from "https://esm.town/v/stevekrouse/date_me_doc_locations";
import Layout from "https://esm.town/v/stevekrouse/dateme_layout";
export default function Home(c) {
return c.html(
<Layout activeTab={new URL(c.req.url).pathname}>
db
@sqlite
Query All Public Vals Example: val town leaderboard import { zip } from "https://esm.town/v/pomdtr/sql";
import { db } from "https://esm.town/v/sqlite/db";
const res = await db.execute("SELECT author_username, COUNT(*) AS val_count FROM vals GROUP BY author_username ORDER BY 2 DESC LIMIT 10");
console.table(zip(res));
HTTP
import { InStatement } from "https://esm.town/v/std/sqlite";
import type { ResultSet } from "npm:@libsql/client";
async function execute(statement: InStatement): Promise<ResultSet> {
const resp = await fetch("https://sqlite-execute.web.val.run", {
method: "POST",

push
@jrmann100
@jsxImportSource npm:hono@3/jsx
HTTP
<script src="https://cdn.jsdelivr.net/gh/philfung/add-to-homescreen@1.9/dist/add-to-homescreen.min.js"></script>
<script>
document.addEventListener('DOMContentLoaded', function () {
window.AddToHomeScreenInstance = new window.AddToHomeScreen({
appName: 'ValPush',
linkInBioTemplate
@Olive
* This web app creates a Side School Seminar location voting system.
* Users can vote for their preferred seminar location from four options.
* The app uses React for the frontend and SQLite for storing votes on the backend.
* The design is inspired by Side.school and includes an image in the first frame.
* It features a celebration animation when voting, a distinct style for the selected option,
* and allows users to cancel their vote by clicking on the selected option again.
HTTP
{ id: 4, name: "Sur Saturne", emoji: "πͺ" },
function App() {
const [votes, setVotes] = useState({});
</div>
function client() {
createRoot(document.getElementById("root")).render(<App />);
client();
async function server(request: Request): Promise<Response> {
const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");

valtownOpenAPI
@pomdtr
Val Town Typescript Spec This val return an up-to-date typescript version of the val.town openapi spec for usage with a feTS client. Usage Deno script import { createClient, type NormalizeOAS } from "npm:fets";
import openapi from "https://pomdtr-valtownOpenAPI.web.val.run/openapi.ts";
export const client = createClient<NormalizeOAS<typeof openapi>>({
endpoint: openapi.servers[0].url,
});
HTTP
import { openapi2TS } from "https://esm.town/v/pomdtr/openapi2TS";
export async function valtownOpenAPI(req: Request) {
return new Response(
await openapi2TS(
val_RSHJYbdIPn
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export async function val_RSHJYbdIPn(req) {
try {
// Execute the code directly and capture its result
web_XbaTV2IAS1
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export async function web_XbaTV2IAS1(req) {
return new Response(`<!DOCTYPE html>
<html>

myApi
@caseyg
An interactive, runnable TypeScript val by caseyg
Script
export function myApi(name) {
return "hi " + name;

fetchTweet
@vladimyr
// @see: https://github.com/vercel/react-tweet/blob/a292ca7/packages/react-tweet/src/api/fetch-tweet.ts#L27-L31
Script
import { fetch } from "https://esm.town/v/std/fetch";
export async function fetchTweet(url) {
const tweetId = url.match(/(\d{19})/)[1];
const token = getToken(tweetId);
return tweetData;
// @see: https://github.com/vercel/react-tweet/blob/a292ca7/packages/react-tweet/src/api/fetch-tweet.ts#L27-L31
function getToken(id: string) {
return ((Number(id) / 1e15) * Math.PI)
.toString(6 ** 2)