Search

Results include substring matches and semantically similar vals. Learn more
stevekrouse avatar
socialDataProxy
@stevekrouse
A proxy that lets Val Town users get some free SocialData Search to power their Twitter Alerts, ie @stevekrouse/twitterAlert I reccomend interfacing with this proxy via this helper function: @stevekrouse/socialDataSearch
HTTP
A proxy that lets Val Town users get some free [SocialData](https://socialdata.tools) Search to power their Twitter Alerts, i
I reccomend interfacing with this proxy via this helper function: @stevekrouse/socialDataSearch
timestamp DATETIME DEFAULT CURRENT_TIMESTAMP
type User = { id: string; username: string; tier: string };
export default async function(req: Request): Promise<Response> {
// authenticate val town user
const Authorization = req.headers.get("Authorization") as string;
pomdtr avatar
echoRef
@pomdtr
An interactive, runnable TypeScript val by pomdtr
Script
import { callerRef, selfRef } from "https://esm.town/v/pomdtr/refs";
export function hello() {
return `Hi ${callerRef().slug}, I'm ${selfRef().slug}`;
chrisk_7777 avatar
myApi
@chrisk_7777
An interactive, runnable TypeScript val by chrisk_7777
Script
let { userCount } = await import("https://esm.town/v/chrisk_7777/userCount");
export function myApi(name) {
if (!userCount) {
userCount = [];
vawogbemi avatar
verbalScarletAntelope
@vawogbemi
WIP Searcher for HN whos hiring posts HonoJs doesn't support render for async components so the style is off for the home page. And the state changes don't register in html rendering so thinking of using react instead.
HTTP
import About from "https://esm.town/v/vawogbemi/whoIsHiringAbout";
function App() {
const tabs = { "/": "Home", "/about": "About" };
: <About />}
function ServerApp() {
return (
hydrateRoot(document.getElementById("root"), <App />);
export default async function(req: Request): Promise<Response> {
const url = new URL(req.url);
rebelpotato avatar
bilibili_methods
@rebelpotato
Methods for accessing the bilibili api with a cookie.
Script
function getBilibiliHeaders(cookie) {
return new Headers({
"Cookie": "SESSDATA=" + cookie.sessdata + "; bili_jct=" + cookie.bilijct + "; DedeUserID=" + cookie.dedeuserid,
function postBilibiliHeaders(cookie) {
return new Headers({
"Cookie": "SESSDATA=" + cookie.sessdata + "; bili_jct=" + cookie.bilijct + "; DedeUserID=" + cookie.dedeuserid,
export function get_bilibili(url, cookie) {
return fetch(url, {
return data.data;
function post_encode(params) {
return Object.keys(params).map(key => encodeURIComponent(key) + "=" + encodeURIComponent(params[key])).join("&");
export function post_bilibili(url, post_data, cookie) {
return fetch(url, {
easrng avatar
oldstyleUtil
@easrng
An interactive, runnable TypeScript val by easrng
Script
import { API_URL } from "https://esm.town/v/std/API_URL?v=5";
export function getMainExport(
mod: any,
noneOkay?: boolean,
throw error;
return mod[exports[0]];
export async function set(path: string, value: any) {
let resolveResp = await fetch(
`${API_URL}/v1/alias/${path}`,
meatcar avatar
watchLCBO_JD3L
@meatcar
An interactive, runnable TypeScript val by meatcar
Cron
import { pushover } from "https://esm.town/v/meatcar/pushover";
import { watchWebsite } from "https://esm.town/v/chet/watchWebsite?v=7";
export async function watchLCBO_JD3L() {
const url = "https://www.lcbo.com/en/storeinventory/?sku=517383";
const { subject, body } = await watchWebsite(url);
dtecho avatar
FetchBasic
@dtecho
Framer Fetch: Basic A basic example of an API endpoint to use with Framer Fetch.
HTTP
import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
function App() {
const [greeting, setGreeting] = useState("");
</div>
function client() {
createRoot(document.getElementById("root")).render(<App />);
if (typeof document !== "undefined") { client(); }
export default async function server(req: Request): Promise<Response> {
const url = new URL(req.url);
bryanma28 avatar
wittyRoseMarmoset
@bryanma28
// Fetches a random joke.
Script
import { email } from "https://esm.town/v/std/email?v=9";
// Fetches a random joke.
async function fetchRandomJoke() {
const response = await fetch(
"https://official-joke-api.appspot.com/random_joke",
Sonu7560 avatar
AviatorGameWithChatGPT
@Sonu7560
@jsxImportSource https://esm.sh/react@18.2.0
HTTP
import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
function AviatorGame() {
const [balance, setBalance] = useState(1000);
</div>
function client() {
createRoot(document.getElementById("root")).render(<AviatorGame />);
if (typeof document !== "undefined") { client(); }
export default async function server(request: Request): Promise<Response> {
return new Response(`
tempguy avatar
retiredRedMarlin
@tempguy
An interactive, runnable TypeScript val by tempguy
Script
import { base } from "https://esm.town/v/tempguy/southcloud";
async function fetchStreamLink() {
try {
const headers = {
} catch (error) {
console.error("Error fetching stream link:", error);
// Call the function
fetchStreamLink();
khy avatar
myApi
@khy
An interactive, runnable TypeScript val by khy
Script
export function myApi(name) {
return "hi " + name;
serna avatar
retThat
@serna
An interactive, runnable TypeScript val by serna
Script
import { retThis } from "https://esm.town/v/serna/retThis";
export async function retThat() {
return await retThis();
Custodia avatar
enchantingScarletChickadee
@Custodia
@jsxImportSource https://esm.sh/react@18.2.0
HTTP
import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
function App() {
const [messages, setMessages] = 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 { OpenAI } = await import("https://esm.town/v/std/openai");
const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
`, [JSON.stringify(messages)]);
const openai = new OpenAI();
const systemPrompt = "Ты дружелюбный и умный ассистент. Отвечай четко и по существу.";
...messages
const stream = await openai.chat.completions.create({
model: "gpt-4o-mini",
saolsen avatar
changes
@saolsen
View val changes as a diff. Go to /v/username/valname/version to see a diff between that version and the previous one. For example https://saolsen-changes.web.val.run/v/saolsen/tracing/108
HTTP
body: string;
async function get_val(
user: string,
body: val_body,
function show_val(
latest_version: number,
<script type="module">
function unescape(str) {
return str.replace(
return c.html(show_val(current_val.version, version_val, prev_val));
async function handler(req: Request): Promise<Response> {
await track("saolsen.changes", req);