Search
myApi
@johanguse
An interactive, runnable TypeScript val by johanguse
Script
export function myApi(name) {
return "hi " + name;
![ccallaway93 avatar](https://images.clerk.dev/oauth_github/img_2T7XSO9h7lvv1Ns70Nn5MLAW0vJ.png)
myApi
@ccallaway93
An interactive, runnable TypeScript val by ccallaway93
Script
export function myApi(name) {
return "hi " + name;
valle_tmp_56208884983514818093201845315532
@janpaul123
@jsxImportSource https://esm.sh/react
HTTP
import OpenAI from "npm:openai";
unless strictly necessary, for example use APIs that don't require a key, prefer internal function
functions where possible. Unless specified, don't add error handling,
The val should create a "export default async function main" which is the main function that gets
function write(text) {
function updateValName(valName) {
function saveVal() {
function openTab(tab) {
function toggleTab() {
const callback = function (mutationsList, observer) {
![treblegni avatar](https://images.clerk.dev/oauth_github/img_2Sksos53MBJQ3olRRdH202ILKtq.png)
myApi
@treblegni
An interactive, runnable TypeScript val by treblegni
Script
export function myApi(name) {
const random = Math.random(100);
return {
calendarEventExtractor
@pdebieamzn
// This calendar app will allow users to upload a PDF, extract events from it using OpenAI's GPT model,
HTTP
// This calendar app will allow users to upload a PDF, extract events from it using OpenAI's GPT model,
// and display them on a big calendar. We'll use react-big-calendar for the calendar component,
const localizer = momentLocalizer(moment);
function App() {
const [events, setEvents] = useState([]);
</div>
function client() {
createRoot(document.getElementById("root")).render(<App />);
if (typeof document !== "undefined") { client(); }
async function server(request: Request): Promise<Response> {
const { OpenAI } = await import("https://esm.town/v/std/openai");
const pdfExtractText = await import("https://esm.town/v/pdebieamzn/pdfExtractText");
const fullText = await pdfExtractText.default(arrayBuffer);
const openai = new OpenAI();
const completion = await openai.chat.completions.create({
messages: [
} catch (error) {
console.error('Error parsing OpenAI response:', error);
console.log('Raw response:', completion.choices[0].message.content);
if (!Array.isArray(events)) {
console.error('Unexpected response format from OpenAI');
return new Response(JSON.stringify({ error: 'Unexpected response format' }), { status: 500, headers: { 'Content-Type': 'application/json' } });
![vladimyr avatar](https://images.clerk.dev/oauth_github/img_2TYEBDWl6QE7Nsk4AHoXsDuwvBE.png)
denoServer
@vladimyr
An interactive, runnable TypeScript val by vladimyr
Script
export function denoServer(handler: (req: Request) => Response | Promise<Response>, thisArg?: any) {
if (thisArg) {
handler = handler.bind(thisArg);
stuckIvoryParakeet
@jamisonl
Bot for Cama discord server. To initialize new slash commands, you have to run a separate bit of code. This is for modifying their functionality
HTTP
Bot for Cama discord server. To initialize new slash commands, you have to run a separate bit of code. This is for modifying their functionality
req.headers.get("X-Signature-Ed25519"),
req.headers.get("X-Signature-Timestamp"),
// Get the user calling this slash command
const userId = await body.member?.user?.id;
if (bank[userId] === undefined) bank[userId] = starting_amount;
myAPI
@haxzie
An interactive, runnable TypeScript val by haxzie
Script
import { untitled_ivoryPuma } from "https://esm.town/v/haxzie/untitled_ivoryPuma";
export function myAPI(message) {
return "hello" + untitled_ivoryPuma();
val_yRrm2hE8eu
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export async function val_yRrm2hE8eu(req) {
try {
// Execute the code directly and capture its result
bookmarkdigest
@ulysse
An interactive, runnable TypeScript val by ulysse
HTTP
import { OpenAI } from "https://esm.town/v/std/openai";
async function summarizePage(input, isUrl = true) {
// Initialize OpenAI API using your own API key
const openai = new OpenAI({
apiKey: Deno.env.get("OPENAI_API_KEY"),
// Use OpenAI API to summarize the text
const completion = await openai.chat.completions.create({
export default async function handleRequest(req) {
"Access-Control-Allow-Headers": "Content-Type, X-OpenAI-Key",
const apiKey = req.headers.get("X-OpenAI-Key");
myApi
@sadfasdfasf
An interactive, runnable TypeScript val by sadfasdfasf
Script
export function myApi(name) {
return "hi " + name + "!!";
val_cVoOy5yJOH
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export async function val_cVoOy5yJOH(req) {
try {
// Execute the code directly and capture its result
val_C41U1hApxX
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export async function val_C41U1hApxX(req) {
try {
// Execute the code directly and capture its result
tolerantOlivePony
@shawnsomething
An interactive, runnable TypeScript val by shawnsomething
HTTP
import { InferableService } from "jsr:@inferable/valtown-adapter";
const service = new InferableService({
description: "My functions",
token: "sk-inf-val-29f8be75-ab85-49ac-8f68-7ed55f18c6bf",
service.registerFunction({
name: "date",
description: "Get the current date",
![stevekrouse avatar](https://images.clerk.dev/uploaded/img_2PqHa2Gsy93xQrjh2w78Xu0cChW.jpeg)
socialDataSearch
@stevekrouse
Helper function to call SocialData Twitter Search API, via my proxy: @stevekrouse/socialDataProxy
Script
Helper function to call [SocialData](https://socialdata.tools) Twitter Search API, via my proxy: @stevekrouse/socialDataProxy
import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
export async function socialDataSearch(query: string): Promise<SocialDataResponse> {
const url = new URL("https://stevekrouse-socialdataproxy.web.val.run/twitter/search");
url.searchParams.set("query", query);