Search

Results include substring matches and semantically similar vals. Learn more
ejfox avatar
googleCalendarWeekEndpoint
@ejfox
// This approach uses Google OAuth to authenticate the user and fetch their actual calendar events for the week.
HTTP
const REDIRECT_URI = Deno.env.get("REDIRECT_URI"); // Should be set to your Val Town endpoint URL + "/callback"
const SCOPES = ["https://www.googleapis.com/auth/calendar.readonly"];
export default async function server(request: Request): Promise<Response> {
const url = new URL(request.url);
const path = url.pathname;
janpaul123 avatar
valle_tmp_91627087308079262770766558032982
@janpaul123
An interactive, runnable TypeScript val by janpaul123
HTTP
export default async function main(req: Request): Promise<Response> {
// Return a basic HTML response with "Hello, World!" message
return new Response("<h1>Hello, World!</h1>", {
janpaul123 avatar
valle_tmp_76415677644054926617324615358083
@janpaul123
// This val responds with "Hello World" to all incoming HTTP requests
HTTP
// This val responds with "Hello World" to all incoming HTTP requests
export default async function main(req: Request): Promise<Response> {
return new Response("Hello World", { headers: { "Content-Type": "text/plain" } });
dhvanil avatar
val_6PIQpS4uDG
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export async function val_6PIQpS4uDG(req) {
try {
// Execute the code directly and capture its result
samwho avatar
sqliteExplorerApp
@samwho
SQLite Explorer View and interact with your Val Town SQLite data. It's based off Steve's excellent SQLite Admin val, adding the ability to run SQLite queries directly in the interface. This new version has a revised UI and that's heavily inspired by LibSQL Studio by invisal . This is now more an SPA, with tables, queries and results showing up on the same page. Install Install the latest stable version (v86) by forking this val: Authentication Login to your SQLite Explorer with password authentication with your Val Town API Token as the password. Todos / Plans [ ] improve error handling [ ] improve table formatting [ ] sticky table headers [x] add codemirror [ ] add loading indication to the run button (initial version shipped) [ ] add ability to favorite queries [ ] add saving of last query run for a table (started) [ ] add visible output for non-query statements [ ] add schema viewing [ ] add refresh to table list sidebar after CREATE/DROP/ALTER statements [ ] add automatic execution of initial select query on double click [x] add views to the sidebar [ ] add triggers to sidebar [ ] add upload from SQL, CSV and JSON [ ] add ability to connect to a non-val town Turso database [x] fix wonky sidebar separator height problem (thanks to @stevekrouse) [x] make result tables scrollable [x] add export to CSV, and JSON (CSV and JSON helper functions written in this val . Thanks to @pomdtr for merging the initial version!) [x] add listener for cmd+enter to submit query
HTTP
- [x] make result tables scrollable
- [x] add export to CSV, and JSON (CSV and JSON helper functions written in [this val](https://www.val.town/v/nbbaier/sqliteE
- [x] add listener for cmd+enter to submit query
xiyouMc avatar
test
@xiyouMc
An interactive, runnable TypeScript val by xiyouMc
Script
export function test() {
return "AAAA";
Aditya230 avatar
yuktiVoiceAssistant
@Aditya230
@jsxImportSource https://esm.sh/react
HTTP
function App() {
function client() {
export default async function server(request: Request): Promise<Response> {
// More robust OpenAI import and initialization
const openaiModule = await import("https://esm.town/v/std/openai");
console.log("OpenAI Module:", Object.keys(openaiModule));
// Use a more flexible approach to accessing OpenAI
const OpenAI = openaiModule.default || openaiModule.OpenAI;
if (!OpenAI) {
throw new Error("Unable to find OpenAI constructor in the imported module");
dpetrouk avatar
expressHTMLExample
@dpetrouk
// View at https://stevekrouse-expressHTMLExample.express.val.run?name=Steve
Script
// View at https://stevekrouse-expressHTMLExample.express.val.run?name=Steve
export async function expressHTMLExample(
req: express.Request,
res: express.Response,
dcalsky avatar
myApi
@dcalsky
An interactive, runnable TypeScript val by dcalsky
Script
export function myApi(name) {
return "hi " + name;
janpaul123 avatar
valle_tmp_7899985259251199683019872792655
@janpaul123
// This val responds to HTTP requests with "Hello world"
HTTP
// This val responds to HTTP requests with "Hello world"
export default async function main(req: Request): Promise<Response> {
return new Response("Hello world");
nick avatar
pelotonWorkouts
@nick
An interactive, runnable TypeScript val by nick
Script
import { fetch } from "https://esm.town/v/std/fetch";
export let pelotonWorkouts = async (credentials) => {
call this function:
@stevekrouse.pelotonWorkouts({username_or_email: 'xxxxx', password: 'yyyyy'})
let loginResponse = await fetch('https://api.onepeloton.com/auth/login', {
janpaul123 avatar
valle_tmp_087532467066469221171456423794679
@janpaul123
// This val will respond with "Hello world" to all incoming HTTP requests
HTTP
// This val will respond with "Hello world" to all incoming HTTP requests
export default async function main(): Promise<Response> {
return new Response("Hello world");
maxm avatar
pretendingToBeRun
@maxm
An interactive, runnable TypeScript val by maxm
HTTP
export default async function(req: Request): Promise<Response> {
// Fork and enable me if you'd like, I did not want to expose my private vals.
status: 500,
if (typeof resp.value !== "function") {
return Response.json({
error: { message: "The first export of this val is not a function and cannot be run with args" },
return Response.json(await resp.value(...args));
function getMainExport(
mod: any,
ibrahim avatar
myApi
@ibrahim
An interactive, runnable TypeScript val by ibrahim
Script
export function myApi(name) {
return "hi " + name;
stevekrouse avatar
firehose
@stevekrouse
@jsxImportSource https://esm.sh/react
HTTP
const agent = new AtpAgent({ service });
function App() {
const [messages, setMessages] = useState([]);
</div>
function client() {
createRoot(document.getElementById("root")).render(<App />);
client();
export default async function server(request: Request): Promise<Response> {
return new Response(