Val Town Code SearchReturn to Val Town

API Access

You can access search results via JSON API by adding format=json to your query:

https://codesearch.val.run/$%7Bart_info.art.src%7D?q=function&page=2460&format=json

For typeahead suggestions, use the /typeahead endpoint:

https://codesearch.val.run/typeahead?q=function

Returns an array of strings in format "username" or "username/projectName"

Found 28553 results for "function"(6597ms)

telegramBotHandlermain.tsx1 match

@stevekrouse•Updated 9 months ago
3import process from "node:process";
4
5export default async function server(req: Request): Promise<Response> {
6 let responseBody = "{}";
7

telegramValTownBotWebhookmain.tsx2 matches

@stevekrouse•Updated 9 months ago
6import { telegramSendMessage } from "https://esm.town/v/vtdocs/telegramSendMessage?v=5";
7
8export default async function server(req: Request): Promise<Response> {
9 // Verify this webhook came from our bot
10 if (
22 let chat = telegramValTownBotSecrets.find((c) => c.chatId === chatId);
23
24 // Helper function to message back the user that triggered this webhook
25 let messageBack = (message) =>
26 telegramSendMessage(Deno.env.get("telegramBot"), {

AIDateInputREADME.md3 matches

@ganeshkumartk•Updated 9 months ago
10- Shows both the parsed date and the original input text
11- Clean, minimalist UI with a clear input field
12- One-click clear functionality
13
14## How It Works
34
35- Modify the Tailwind CSS classes in the HTML to change the styling
36- Adjust the date formatting in the `formatDate` function
37- Change the parsing behavior by modifying the `detectDate` function
38
39## Dependencies

buttonmain.tsx2 matches

@stevekrouse•Updated 9 months ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export default async function server(req: Request): Promise<Response> {
4 async function inlineUrls(cssString: string) {
5 const urlRegex = /url\(['"]?(.*?)['"]?\)/g;
6 let result = cssString;

adorableRedChameleonmain.tsx3 matches

@jamisonl•Updated 9 months ago
22const rest = new REST({ version: "9" }).setToken(process.env.DISCORD_BOT_TOKEN);
23
24async function findUserVoiceChannel(guildId, userId) {
25 try {
26 const channels = await rest.get(Routes.guildChannels(guildId));
39}
40
41async function sayMessage(guildId, channelId, message) {
42 const url = googleTTS.getAudioUrl(message, {
43 lang: "en",
68}
69
70function createDiscordJSAdapter(channelId, guildId) {
71 return {
72 sendPayload: (payload) => {

windowsXpSimulatormain.tsx6 matches

@xpapla•Updated 9 months ago
7import { createRoot } from "https://esm.sh/react-dom/client";
8
9function App() {
10 const [startMenuOpen, setStartMenuOpen] = useState(false);
11 const [windows, setWindows] = useState([]);
119}
120
121function DesktopIcon({ icon, label, onClick }) {
122 return (
123 <div className="desktop-icon" onClick={onClick}>
128}
129
130function Window({ window, isActive, onClose, onMinimize, isMinimized, onFocus, updatePosition }) {
131 const [isDragging, setIsDragging] = useState(false);
132 const [dragOffset, setDragOffset] = useState({ x: 0, y: 0 });
219}
220
221function Taskbar({ startMenuOpen, toggleStartMenu, openWindow, onInstagramClick, time, windows, minimizedWindows, restoreWindow }) {
222 return (
223 <div className="taskbar">
251}
252
253function client() {
254 createRoot(document.getElementById("root")).render(<App />);
255}
259}
260
261async function server(request: Request): Promise<Response> {
262 return new Response(`
263 <!DOCTYPE html>

aqimain.tsx1 match

@amoeba•Updated 9 months ago
2import { easyAQI } from "https://esm.town/v/stevekrouse/easyAQI?v=5";
3
4export async function aqi(interval: Interval) {
5 const location = "seattle, wa"; // <-- change to place, city, or zip code
6 const data = await easyAQI({ location });

zillowScrapermain.tsx1 match

@rochambeau314•Updated 9 months ago
6import cheerio from "https://esm.sh/cheerio@1.0.0-rc.12";
7
8export default async function server(request: Request): Promise<Response> {
9 const url = new URL(request.url);
10 const zillowUrl = url.searchParams.get("url");

craigslistScrapermain.tsx3 matches

@rochambeau314•Updated 9 months ago
7import { createRoot } from "https://esm.sh/react-dom/client";
8
9function App() {
10 const [url, setUrl] = useState('');
11 const [listing, setListing] = useState(null);
59}
60
61function client() {
62 createRoot(document.getElementById("root")).render(<App />);
63}
65if (typeof document !== "undefined") { client(); }
66
67async function server(request: Request): Promise<Response> {
68 const url = new URL(request.url);
69 const cheerio = await import("https://esm.sh/cheerio@1.0.0-rc.12");

adorableRedChameleonREADME.md1 match

@jamisonl•Updated 9 months ago
1Bot for Cama discord server. To initialize new slash commands, you have to run a separate bit of code. This is for modifying their functionality

getFileEmail4 file matches

@shouser•Updated 1 month ago
A helper function to build a file's email
tuna

tuna8 file matches

@jxnblk•Updated 1 month ago
Simple functional CSS library for Val Town
lost1991
import { OpenAI } from "https://esm.town/v/std/openai"; export default async function(req: Request): Promise<Response> { if (req.method === "OPTIONS") { return new Response(null, { headers: { "Access-Control-Allow-Origin": "*",
webup
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.